// Example of using Scanline with pf16bit Bitmap // efg, Sept 98 procedure TForm1.ButtonFillYellowPf16bitClick(Sender: TObject); VAR Bitmap: TBitmap; i : INTEGER; j : INTEGER; R : 0..31; // 5 bits G : 0..63; // 6 bits (eye is most sensitive to green) B : 0..31; // 5 bits RGB : WORD; Row : pWordArray; // from SysUtils begin Bitmap := TBitmap.Create; TRY Bitmap.Width := Image1.Width; Bitmap.Height := Image1.Height; Bitmap.PixelFormat := pf16bit; R := 31; // Max Red G := 63; // Max Green B := 0; // No Blue // "FillRect" using Scanline RGB := (R SHL 11) OR (G SHL 5) OR B; // "yellow" FOR j := 0 TO Bitmap.Height-1 DO BEGIN Row := Bitmap.Scanline[j]; FOR i := 0 TO Bitmap.Width-1 DO Row[i] := RGB END; Image1.Picture.Graphic := Bitmap FINALLY Bitmap.Free END end;