{
ScanLine, Height example
}
procedure TForm1.Button1Click(Sender: TObject);
// This example shows drawing directly to the BitMap
var
  x,y : Integer;
  BitMap : TBitMap;
  P : PByteArray;
begin
  BitMap := TBitMap.create;
  try
    // On Windows replace MyBitmap.png with a full pathname such as
    // C:\Program Files\Common Files\Borland Shared\Images\Splash\256color\factory.bmp
    BitMap.LoadFromFile('MyBitmap.png');
    for y := 0 to BitMap.Height -1 do
    begin
      P := BitMap.ScanLine[y];
      for x := 0 to BitMap.Width -1 do
        P[x] := y;
    end;
    Canvas.Draw(0,0,BitMap);
  finally
    BitMap.Free;
  end;
end; 
