Board index » delphi » Are printer.canvas and timage.canvas different?

Are printer.canvas and timage.canvas different?

Are printer.canvas and timage.canvas different?
I want write a print preview using TPrinter component.
How can I do the result image for Tprinter?
 

Re:Are printer.canvas and timage.canvas different?


Quote
Young Chuen Fu wrote in message <35A484A9.90189...@alltop.chiayi.com.tw>...
>Are printer.canvas and timage.canvas different?
>I want write a print preview using TPrinter component.
>How can I do the result image for Tprinter?

Yes the two canvases are different.

You can write a generic routine that draws on a canvas.  The same routine
can draw on the screen or on the printer.

For a simple example of this, take a look at the "Simple Bar Chart" example
on the Graphics page in my Computer Lab.  Press the "Show Bars" but for
display on the screen, or the "Print" button to print.  In addition, the
"Write BMP" draws on an in-memory TBitmap canvas and saves the graphic to a
file.

Some of the other examples on the Graphics page show this technique, too,
but perhaps are a bit more complicated.

efg
_________________________________________
efg's Computer Lab:  http://infomaster.net/external/efg

Earl F. Glynn                 E-Mail:  EarlGl...@att.net
MedTech Research Corporation, Lenexa, KS  USA

Other Threads