Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Printing Bitmap in the Center

Posted on 1998-08-06
2
Medium Priority
?
253 Views
Last Modified: 2013-11-20
Hi friends,
                I want to print a bitmap in the center of the page.
               I used CDib class and made  my changes in the OnDraw()
function.It's getting printed only in the top even though I changed  my  left and topmost position.
Can anyone please help me.
Thaxs in advance.

0
Comment
Question by:tmmet
[X]
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
2 Comments
 

Author Comment

by:tmmet
ID: 1320351
Edited text of question
0
 
LVL 7

Accepted Solution

by:
psdavis earned 40 total points
ID: 1320352
I'm going to be that it's a mapping mode problem.  If you're printer is using the pDC->SetMapMode( MM_TWIPS ) for example, then all of your coordinates need to be multiplied by 1440.  

Here's a snipplet of some code that I use to display stuff on the printer.  Notice the MapMode conversion.

BITMAP bm;
pLogo.GetBitmap( &bm );

CPoint ptSize( bm.bmWidth, bm.bmHeight );      
pDC->DPtoLP( &ptSize );      

CPoint ptOrg(0,0);
pDC->DPtoLP(&ptOrg );   // Create a memory DC compatible with the destination DC

CDC pMemDC;
pMemDC.CreateCompatibleDC( pDC );
pMemDC.SetMapMode( pDC->GetMapMode() );      
 
CBitmap* pOldBitmap = (CBitmap*) pMemDC.SelectObject( &pLogo );      

Phillip


0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

647 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