Solved

Printing Bitmap in the Center

Posted on 1998-08-06
2
240 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 20 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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 97
Expand LInux Boot partition remotly 3 102
sum67 challenge 35 116
Sed question 2 122
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

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