Click here to Skip to main content
15,918,243 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to create an installation program for my program? Pin
momer14-Dec-04 15:00
momer14-Dec-04 15:00 
AnswerRe: How to create an installation program for my program? Pin
Larry Antram14-Dec-04 15:08
Larry Antram14-Dec-04 15:08 
GeneralRe: How to create an installation program for my program? Pin
momer14-Dec-04 15:58
momer14-Dec-04 15:58 
GeneralMFC dialog box menu weirdness Pin
Uncle Vance14-Dec-04 14:37
Uncle Vance14-Dec-04 14:37 
QuestionCan some body help me.... Pin
Indra_Putra14-Dec-04 13:34
Indra_Putra14-Dec-04 13:34 
AnswerRe: Can some body help me.... Pin
Maximilien14-Dec-04 14:19
Maximilien14-Dec-04 14:19 
AnswerRe: Can some body help me.... Pin
BRIMID15-Dec-04 1:49
BRIMID15-Dec-04 1:49 
GeneralPrint image with DrawImage in GDI+ Pin
giannibal14-Dec-04 12:36
giannibal14-Dec-04 12:36 
I'm trying to print an image to an area with certain dimensions in GDI+. First I construct a graphics object:

Graphics graphics(dc.m_hDC);

Then I load the image and print it:

graphics.DrawImage(pImage, rfDraw, rfPic.X, rfPic.Y, rfPic.Width, rfPic.Height, UnitPixel);

The rfPic rectangle is the source area to draw from, containing e.g. (0, 0, 1000, 800), the entire 1000 x 800 pixel image (I need to have the possibility to draw a portion of the image). The rfDraw rectangle is the destination area to draw to, containing e.g. (100, 100, 6100, 4900).

The printer has a 600 x 600 dpi resolution. Thus the printed image should be:
(6100 - 100) pixels / 600 dpi = 10 inches wide, and:
(4900 - 100) pixels / 600 dpi = 8 inches high.

However, the image is blown up to gigantic proportions. Can someone tell me why?

With smaller values in rfDraw, it works as expected when drawing to screen (which is 'just another device', but with 96 dpi). Also, similar code worked perfectly in GDI (without the +), using IPicture. I ported the code to GDI+, to be able to rotate and more.

I tried: using other unit values, like UnitDocument; setting the page scale and units to different values; checking the device resolution (indeed 600 dpi in both directions).

This is costing me a lot of paper and printer cartridges! Please help!



Thanks in advance!
Generalgetting icon Pin
pnpfriend14-Dec-04 11:26
pnpfriend14-Dec-04 11:26 
GeneralRe: getting icon Pin
David Crow15-Dec-04 4:23
David Crow15-Dec-04 4:23 
GeneralReading data from Serial Port. Pin
CNewbie14-Dec-04 10:34
CNewbie14-Dec-04 10:34 
GeneralRe: Reading data from Serial Port. Pin
wwwhb200014-Dec-04 14:00
wwwhb200014-Dec-04 14:00 
GeneralFreeing up memory Pin
poiut14-Dec-04 10:29
poiut14-Dec-04 10:29 
GeneralRe: Freeing up memory Pin
David Crow15-Dec-04 2:05
David Crow15-Dec-04 2:05 
GeneralRe: Freeing up memory Pin
poiut15-Dec-04 6:28
poiut15-Dec-04 6:28 
GeneralRe: Freeing up memory Pin
poiut15-Dec-04 6:34
poiut15-Dec-04 6:34 
GeneralMFC File Input and Output problem Pin
Member 158681214-Dec-04 10:25
Member 158681214-Dec-04 10:25 
GeneralCHtmlView + focus Pin
iifisher14-Dec-04 10:21
iifisher14-Dec-04 10:21 
GeneralRegister an Active X Control Pin
jerry1211a14-Dec-04 9:56
jerry1211a14-Dec-04 9:56 
GeneralRe: Register an Active X Control Pin
Graham Bradshaw14-Dec-04 10:42
Graham Bradshaw14-Dec-04 10:42 
Generalproblem with long c++ file Pin
dolph_loe14-Dec-04 9:51
dolph_loe14-Dec-04 9:51 
GeneralRe: problem with long c++ file Pin
Sawatzky14-Dec-04 10:55
Sawatzky14-Dec-04 10:55 
GeneralRe: problem with long c++ file Pin
Todd Smith14-Dec-04 11:19
Todd Smith14-Dec-04 11:19 
Questionhow does dialog catch char input? Pin
LeeeNN14-Dec-04 9:08
LeeeNN14-Dec-04 9:08 
AnswerRe: how does dialog catch char input? Pin
David Crow14-Dec-04 9:47
David Crow14-Dec-04 9:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.