Solved

Printing

Posted on 1998-08-04
2
173 Views
Last Modified: 2013-11-19
Since there is a lot of drawing that has been done in the OnDraw in pixels .I am mapping the printer pixels to scale the figure in the Ondraw. It draws the lines and fonts but for some reason it ignores the bitmap how to sclale the bitmaps on the screen ????
0
Comment
Question by:sram
  • 2
2 Comments
 
LVL 7

Accepted Solution

by:
psdavis earned 30 total points
Comment Utility
This is basically how I do it.  You may want to try a version of this...

CYourView::PrintThisPage( )
{
.

   CDC*     pTempDC     = new CDC;
   CBitmap* pForteLogo  = new CBitmap;
   
   pForteLogo->LoadBitmap( IDB_FORTE_IMAGE );
   pTempDC   ->CreateCompatibleDC( pDC );
   
   CBitmap* pOldBitmap  = pTempDC->SelectObject( pForteLogo );
   pDC->StretchBlt( 9000, -8000, 1775, -1775, pTempDC, 0, 0, 355, 355, SRCCOPY );
   
   pTempDC->SelectObject( pOldBitmap );
   pOldBitmap->DeleteObject( );
   
   delete pForteLogo;
   delete pTempDC;
.
}

Phillip
0
 
LVL 7

Expert Comment

by:psdavis
Comment Utility
To help you out a bit, I kind of need to tell you how I computed some of these numbers.  I'm using pDC->SetMapMode( MM_TWIPS ) for my scaling.  The numbers that you see, 9000, 1775 are positions on the paper (I use floats) that are multiplied by 1440.  The negative positions: -8000, -1775 are because Y is inverted.  You have to display Y in negatives to print on the screen.

Phillip
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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: …

762 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

7 Experts available now in Live!

Get 1:1 Help Now