Board index » delphi » Saving contents of a TCanvas

Saving contents of a TCanvas

This must be a trivial question but I cannot find the answer in the D4 help
file.

Is there a way in which I can save the contents of a TCanvas object to a
disk file?  E.g. a .bmp file or, preferably, a .jpg, as I want to send it as
an e-mail attachment.

John Dennis

 

Re:Saving contents of a TCanvas


The easiest way to do this is create a TBitmap, set the size and
characteristics, and then do your drawing to the bitmap's canvas. You
can then either save it as a BMP (SaveToFile) or copy it (Assign) to a
TJPEGImage where you can save it to a file.

Mitch Wolberg
RockWare, Inc.
mi...@rockware.com

Quote
John Dennis wrote:

> This must be a trivial question but I cannot find the answer in the D4 help
> file.

> Is there a way in which I can save the contents of a TCanvas object to a
> disk file?  E.g. a .bmp file or, preferably, a .jpg, as I want to send it as
> an e-mail attachment.

> John Dennis

Other Threads