Click to See Complete Forum and Search --> : Print a bitmap


Eran
June 30th, 1998, 02:48 AM
How can i print a bitmap ?

Wes Rogers
July 14th, 1998, 10:56 AM
Dear Eran,


Printing a bitmap is exactly like displaying one:


You just do a bitblt, etc. to the printer DC, the same as to a display DC.


Be aware, however, that printers don't always support all the raster operation codes you might be using. You should do a GetDeviceCaps to make sure

that your blitting will work on the device


Also, postscript printers will not interpret most raster operation codes correctly in any event; this is frustrating if you have a transparency color in your bitmap.


Yours,

Wes Rogers

Larry Widing
July 29th, 1998, 04:34 PM
I have to disagee with Wes's suggestion. Very few printer drivers support BitBlt, except for monochrome (2-color) bitmaps.


The approach that will work over the widest range of printer drivers is to use StretchDIBits(). But, this will require converting a device dependant bitmap (either a CBitmap or HBITMAP) to a DIB.


Larry Widing /WUGNET

MVP, CSP

B Murali Mohan
May 31st, 1999, 04:09 AM
Can I get the source code for this????