[Lazarus] TLazIntfImage GetDataLineStart

theo xpde at theo.ch
Sun Jul 18 01:02:03 CEST 2010


Ah,  now I see. Thanks!

I tried like below, it seems to work.
TBitmap.LoadFromIntfImage seems to care about the back-conversion, right?

procedure TForm1.Button1Click(Sender:TObject);
var li1,li2:TLazIntfImage;
  Description: TRawImageDescription;
  Row1: PRGBQuadArray;
i:integer;
begin
Li1:=TLazIntfImage.Create(0,0);
Li1.LoadFromDevice(Image1.Canvas.Handle);
Writeln(Li1.DataDescription.AsString);
Description.Init_BPP32_B8G8R8A8_BIO_TTB(Li1.Width,Li1.Height);
Li2:=TLazIntfImage.Create(0,0);
Li2.DataDescription:=Description;
Li2.CopyPixels(Li1);
Row1:=Li2.GetDataLineStart(3);
for i:=0 to 20 do
  begin
    Row1^[i].rgbRed:=$FF;
    Row1^[i].rgbGreen:=$88;
    Row1^[i].rgbBlue:=$88;
  end;

Writeln(Li2.DataDescription.AsString);
Image2.Picture.Bitmap.LoadFromIntfImage(Li2);
end;






More information about the Lazarus mailing list