Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

How to print a CBitmap with print and print preview?

Posted on 1998-07-29
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?

Question by:AlainRoyer
  • 2

Accepted Solution

trestan earned 100 total points
ID: 1319905
Pls see the following instructions for convert BMP to DIB:
Good luck.

Expert Comment

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

Expert Comment

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.


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 96
Macro to save highlighted rows as a separate file 5 45
no14 challenge 14 71
Work with App store 7 68
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

839 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