Click here to Skip to main content
15,892,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Creating a large DC Pin
bob1697226-Oct-07 4:46
bob1697226-Oct-07 4:46 
QuestionRe: Creating a large DC Pin
Hamid_RT26-Oct-07 7:30
Hamid_RT26-Oct-07 7:30 
AnswerRe: Creating a large DC Pin
Meisterzunge26-Oct-07 11:03
Meisterzunge26-Oct-07 11:03 
GeneralRe: Creating a large DC Pin
Meisterzunge26-Oct-07 11:22
Meisterzunge26-Oct-07 11:22 
GeneralRe: Creating a large DC Pin
bob1697226-Oct-07 21:04
bob1697226-Oct-07 21:04 
QuestionRe: Creating a large DC Pin
Meisterzunge27-Oct-07 21:42
Meisterzunge27-Oct-07 21:42 
GeneralRe: Creating a large DC Pin
Meisterzunge28-Oct-07 1:29
Meisterzunge28-Oct-07 1:29 
GeneralRe: Creating a large DC Pin
Force Code26-Oct-07 23:34
Force Code26-Oct-07 23:34 
Meisterzunge wrote:
As msdn says, we can't use 'StretchBlt()' when the source and target dc sizes differs much.


This doesn't apply when StretchBlting from a screen-compatible memdc to a printer dc. Try StretchBlt and I think you'll get the results you're looking for.

When creating a screen-compatible memdc, you may want to give it the same ratio of width to height as a printer dc as follows:

HDC hdc = GetDC(0);
prn_dat.w = GetDeviceCaps(prn_hdc,HORZRES);
prn_dat.h = GetDeviceCaps(prn_hdc,VERTRES);
prn_dat.dw = GetDeviceCaps(hdc,LOGPIXELSX);
prn_dat.dw /= GetDeviceCaps(prn_hdc,LOGPIXELSX);
prn_dat.dh = GetDeviceCaps(hdc,LOGPIXELSY);
prn_dat.dh /= GetDeviceCaps(prn_hdc,LOGPIXELSY);

w = mulr(prn_dat.w,prn_dat.dw);
h = mulr(prn_dat.h,prn_dat.dh);

(The values in prn_dat are floating point and mulr is just my own routine for multiplication with rounding which may or may not be necessary. When you create a memdc use w,h as dimensions for the bitmap.)
QuestionKeyboard accelerators and docking bars Pin
bob1697226-Oct-07 4:16
bob1697226-Oct-07 4:16 
QuestionHow to make a listener on a folder, for client-server data synchronization? Pin
Caetano.n.a26-Oct-07 1:53
Caetano.n.a26-Oct-07 1:53 
AnswerRe: How to make a listener on a folder, for client-server data synchronization? Pin
David Crow26-Oct-07 2:39
David Crow26-Oct-07 2:39 
QuestionWake On LAN Problem Pin
joshiprashant26-Oct-07 1:18
joshiprashant26-Oct-07 1:18 
AnswerRe: Wake On LAN Problem Pin
baerten26-Oct-07 3:03
baerten26-Oct-07 3:03 
GeneralRe: Wake On LAN Problem Pin
joshiprashant26-Oct-07 3:48
joshiprashant26-Oct-07 3:48 
GeneralRe: Wake On LAN Problem Pin
baerten26-Oct-07 4:07
baerten26-Oct-07 4:07 
QuestionHow to find the path of my current running application Pin
chandu00426-Oct-07 0:51
chandu00426-Oct-07 0:51 
AnswerRe: How to find the path of my current running application Pin
Hamid_RT26-Oct-07 0:56
Hamid_RT26-Oct-07 0:56 
GeneralRe: How to find the path of my current running application Pin
chandu00426-Oct-07 1:16
chandu00426-Oct-07 1:16 
GeneralRe: How to find the path of my current running application Pin
Rajesh R Subramanian26-Oct-07 1:22
professionalRajesh R Subramanian26-Oct-07 1:22 
GeneralRe: How to find the path of my current running application Pin
Hamid_RT26-Oct-07 1:24
Hamid_RT26-Oct-07 1:24 
GeneralRe: How to find the path of my current running application Pin
chandu00426-Oct-07 1:44
chandu00426-Oct-07 1:44 
GeneralRe: How to find the path of my current running application Pin
Hamid_RT26-Oct-07 1:53
Hamid_RT26-Oct-07 1:53 
GeneralRe: How to find the path of my current running application Pin
chandu00426-Oct-07 1:59
chandu00426-Oct-07 1:59 
GeneralRe: How to find the path of my current running application Pin
Roger Stoltz26-Oct-07 1:33
Roger Stoltz26-Oct-07 1:33 
GeneralRe: How to find the path of my current running application Pin
chandu00426-Oct-07 3:01
chandu00426-Oct-07 3:01 

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.