procedure TForm1.Button1Click(Sender: TObject); var x,y : Integer; BitMap : TBitMap; P : PByteArray; begin BitMap := TBitMap.create; try BitMap.height := 512; BitMap.width := 512; BitMap.PixelFormat := pf8bit; 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;
x,y : Integer;
BitMap : TBitMap;
P : PByteArray;
begin
BitMap := TBitMap.create;
try
BitMap.height := 512;
BitMap.width := 512;
BitMap.PixelFormat := pf8bit;
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;