From: "Earl F. Glynn" Newsgroups: borland.public.kylix.graphics References: <3B360C6F.78407CC5@sympatico.ca> <3B360ED3.3B4890B4@sympatico.ca> <3b36d6b1_1@dnews> Subject: Re: Missing Pixels property of TCanvas Date: Mon, 25 Jun 2001 01:38:59 -0500 Lines: 70 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 "Earl F. Glynn" wrote in message news:3b36d6b1_1@dnews... > "ELevac" wrote in message > news:3B360ED3.3B4890B4@sympatico.ca... > > > Use the ScanLine property. > For pf32bit, each Scanline is an array of 32-bit values. The TRGBQuad > record worked in Delphi and you can use a similar approach in Kylix > but I think you need to define the TRGBQuad since it's not defined > in Kylix (but is in Delphi). Here's an actual Kylix Scanline example using a pf32bit Scanline: implementation {$R *.xfm} TYPE TRGBQuad = // from Delphi's windows.pas PACKED RECORD rgbBlue : BYTE; rgbGreen: BYTE; rgbRed : BYTE; rgbReserved: BYTE END; pRGBQuad = ^TRGBQuad; TRGBQuadArray = ARRAY[WORD] OF TRGBQuad; pRGBQuadArray = ^TRGBQuadArray; procedure TForm1.Button1Click(Sender: TObject); VAR Bitmap: TBitmap; i,j : WORD; row : pRGBQuadArray; begin Bitmap := TBitmap.Create; TRY Bitmap.PixelFormat := pf32bit; Bitmap.Width := Image1.Width; Bitmap.Height := Image1.Height; FOR j := 0 TO Bitmap.Height - 1 DO BEGIN row := Bitmap.Scanline[j]; FOR i := 0 TO Bitmap.Width -1 DO BEGIN WITH row[i] DO BEGIN rgbBlue := 0; rgbRed := 255; // R + G = Yellow rgbGreen := 255; rgbReserved := 0; // just to be deterministic END END END; Image1.Picture.Graphic := Bitmap; FINALLY Bitmap.Free END end; end. -- efg -- Earl F. Glynn, Overland Park, KS USA efg's Computer Lab Mirror: http://homepages.borland.com/efg2lab