Board index » delphi » Putting a Bitmap onto the Printer canvas

Putting a Bitmap onto the Printer canvas

Hello All

I have been having difficulty putting my bitmap to the printer canvas. I
try the following to put my bitmap BM to the printer canvas, but nothing
comes out. It needs to be stretched.

Printer.Canvas.StretchDraw(Area, BM);

Right now I just use windows API calls to set the viewport and use a two
dimensional loop to draw my Bitmap to the printer.

Anybody have any suggestions.

Thanks
Phil
--
Phil Osborne
Information Systems Developer
EcoTech Research Ltd.

 

Re:Putting a Bitmap onto the Printer canvas


Quote
Philippe A.M. Osborne wrote in message <35E86DCA.1DFB...@cs.uregina.ca>...
>Hello All

>I have been having difficulty putting my bitmap to the printer canvas. I
>try the following to put my bitmap BM to the printer canvas, but nothing
>comes out. It needs to be stretched.

>Printer.Canvas.StretchDraw(Area, BM);

Unless you're lucky with your particular printer, Draw or StretchDraw
usually doesn't result in very good image quality in printed images.  You
need to use the StretchDIBits API call.

Take a look at Printer Demo #1 in my Computer Lab (look for the Other
Projects section) for a sample of StretchDIBits and a comparison of Draw,
StretchDraw, StretchDIBits on a variety of printers.

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

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

Re:Putting a Bitmap onto the Printer canvas


Hi Phil.
I think your printer doesn't support StretchBlt (you can see its
capabilities from the TPrinter class without problem)
If that's the problem, then just create a bitmap in memory, size it to the
Printer Canvas size and stretchBlt to it, then you'll just have to do a
bitblt from that bitmap to the printer and voila. I don't send you an
example because I have it done in C++ Builder.
now this technique works good for a color printer, but give poor results
with a gray-scale.....

Olivier.

Other Threads