Цитата(Ofer @ 15.11.2008, 22:10 ) | | не пойму к чему это |
К вот этому:
| Код | 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;
|
AntonN, да немного ошибся. Ofer, попробуй этот код:
| Код | 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 begin P[x * 3] := 255; // цвет синий P[x * 3 + 1] := 255;// цвет зелёный P[x * 3 + 2] := 255;// цвет красный end; end; Canvas.Draw(0,0,BitMap); finally BitMap.Free; end; end;
|
|