How to print a CBitmap with print and print preview?

I have a CBitmap in a CView. When I try to print it, I only have a small black rectangle. When I used print preview it's ok but my CBitmap is too small. I know that I must convert it to a DIB but how can I transfert a CBitmap to a DIB and how can I make my DIB use the entire page?

Thanks
AlainRoyerAsked:
Who is Participating?
 
trestanConnect With a Mentor Commented:
Pls see the following instructions for convert BMP to DIB:
http://www.codeguru.com/bitmap/ddb_to_dib.shtml
http://www.codeguru.com/bitmap/dibsection_from_bmp.shtml
Good luck.
0
 
trestanCommented:
Also pls refer to the online help at:
Platform SDK -> Graphics and Multimedia Services -> 2-D Graphics -> Printing and Print Spooler -> Printing a Document
0
 
psdavisCommented:
Also extremely useful is StretchDIBits.  Once you have a DIB, stretch the bitmap to the page to get the printed size you want.

Phillip
 
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.