Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to copy bitmap to canvas ?

Status
Not open for further replies.

BxyzB

Programmer
Jan 21, 2003
9
IL
Hi !

I need to know how to copy paint on bitmap to canvas...

Thanks !
 
Howdy there.
Code:
  Canvas.Draw(0, 0, MyBitmap);
--- markus
 
Oh no....

sorry , but i mean how to copy Canvas to bitmap...

sorry...
 
Drop on a TImage at least 10 by 10
and:-

procedure TForm1.Button1Click(Sender: TObject);
begin
image1.Picture.SaveToFile('c:\temppic.bmp')
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
image1.Canvas.MoveTo(0,0);
image1.Canvas.lineto(10,10);
end;

steve

creates a bitmap!!
 
var
vbmp:TBitmap;
vrect:TRect;
begin
vbmp:=TBitmap.Create;
vbmp.Width:=500;
vbmp.Height:=300;


vrect:=RECT(0,0,vbmp.Width,vbmp.Height);
vbmp.Canvas.CopyRect(vrect, Canvas,vrect);
// ~~~~~~Source Canvas

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top