Solved

How to print a CBitmap with print and print preview?

Posted on 1998-07-29
3
395 Views
Last Modified: 2013-11-20
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
0
Comment
Question by:AlainRoyer
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
trestan earned 100 total points
ID: 1319905
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
 
LVL 8

Expert Comment

by:trestan
ID: 1319906
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
 
LVL 7

Expert Comment

by:psdavis
ID: 1319907
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

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now