Haven't been able to send a bitmap to a printer. Tried the example in the API Help file, but it fails to work. I can send a rectangle and text to the printer but moving the bitmap into the printer device fails. Any suggestions or code snippets would be appreciated. Thanks guys.
Posted on 2001-10-27 10:08:54 by Mike 1
Afternoon, Mike 1.

Haven't been able to send a bitmap to a printer. Tried the example in the API Help file, but it fails to work. I can send a rectangle and text to the printer but moving the bitmap into the printer device fails. Any suggestions or code snippets would be appreciated. Thanks guys.


I've got a book called :
"Schildt's advanced Windows 95 programming in C and C++".

One of the sections is on printing, however it doesn't have a floppy with the source code.

If you show the code you're currently using, I may be able to see the problem.

Going by what you've said, you're trying to move the bitmap *into* the printers' DC. You can't do this (as you've found out). In this book, it says that you've got to:
#Create a *compatible memory DC*.
#Select the bitmap into that device context.
#And then copy it to the printers' device context using either *BitBlt* or *StretchBlt*.

Another complication is that the bitmap may not be compatible with the printers' device context.

Then you'll have to:
#Create a *printer-compatible* bitmap.
#Select that bitmap into a *printer-compatible memory DC*.
#Copy the bitmap you want to print into the *printer-compatible* bitmap.
#And then copy it to the printers' device context using either *BitBlt* or *StretchBlt*.

Hope this helps a little.

Cheers,
Scronty
Posted on 2001-10-27 22:51:05 by Scronty
I have already done that! NASM
NaGoA Visual Assembler

http://planeta.clix.pt/nasm/examples.html
Posted on 2001-10-28 11:14:21 by Nguga
Thanks for the replies guys. I'll try your suggestions. Tried your suggestion Nguga and it worked. Thanks again
Posted on 2001-10-28 17:24:27 by Mike 1