Please, somebody help me !!! I need to draw something and save it as a bmp file. I do it like this:
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
with PaintBox1, canvas do
begin
Pen.Style := psDash;
pen.Width:=4;
pen.Color:=clBlack;
moveto(2,2);
lineto(100, 2);
end;
end;
procedure TForm1.BtnSaveClick(Sender: TObject);
var bmp : TBitmap;
begin
bmp := TBitmap.Create;
try
bmp.width := paintbox1.Width;
bmp.height:= paintbox1.Height;
bmp.Canvas.CopyRect(Rect(0, 0, -bmp.Width, bmp.Height),PaintBox1.Canvas, PaintBox1.Canvas.ClipRect);//Here creates a black rectangle
bmp.savetofile('/Users/stad/Desktop/bit4.bmp');
finally
end;
end;
And Finally, create a bitmap with black background. Please may be someday knows?