Lazarus, Linux, LCL, GTK2
How can I make it normal?
(Under Windows, a 10x10 pixel square, as expected)procedure TForm1.FormCreate(Sender: TObject);
var
pData: PUint32;
x, y: integer;
begin
Image1.Width:=20;
Image1.Height:=20;
Image1.Picture.Bitmap.PixelFormat:=pf32bit;
Image1.Picture.Bitmap.Width:=20;
Image1.Picture.Bitmap.Height:=20;
Caption := TypInfo.GetEnumName(TypeInfo(TPixelFormat), Ord(Image1.Picture.Bitmap.PixelFormat));
Caption := Caption + ', ' + Image1.Picture.Bitmap.RawImage.Description.BitsPerPixel.ToString;
Image1.Picture.Bitmap.BeginUpdate();
for y:=0 to 9 do
begin
pData:=PUInt32(Image1.Picture.Bitmap.RawImage.GetLineStart(y));
for x:=0 to 9 do
PUInt32(pData)[x]:=$FFFFFFFF;
end;
Image1.Picture.Bitmap.EndUpdate();
end;