Help with Printing Bitmaps

Help with Printing Bitmaps

Post by Craig Buc » Tue, 08 Feb 2000 04:00:00

I tried to bitblt a CBitmap object into a printer DC, just as if it was a
display DC, and it printed
a black square instead.  Is there some type of initialization needed?
Please help!


Craig Buck


1. Printing a window's bitmap (simulating Alt+PrintScrn followed by a paste then print)

Yes.  You will need a DIB.  You will use GetDIBits to transfer from
the screen to the DIB, then StretchDIBits to transfer from the DIB to
the printer.  The reason that StretchBlt doesn't work is that the
respective driver provides meaning to the format of the memory used
for its device surface.  Display surfaces have a different format that
printers.  Indeed, this is part of the motivation for the DIB; it is
device-independent.  If it were me, I would probably create a 24bpp
DIB and avoid color table anoyances when blitting, otherwise you'll
have to set up a palette too.

I see no water here.

2. new Open Source, Fantasy Role-Playing game development project

3. Gloom Deluxe

4. print/print preview for bitmaps

5. ANNOUNCE: surface v0.1va

6. Printing transparent bitmaps - Help!

7. reuse of TRG XL-Board

8. HELP needed: Trouble while printing bitmaps...

9. help printing/displaying image/bitmap from buffer

10. HELP needed: Trouble while printing bitmaps...

11. Help needed for printing bitmaps

12. HELP Bitmap Printing in VB