Click here to Skip to main content
15,914,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: BitBlt does not work in print preview Pin
Mark Salsbery18-Sep-08 6:34
Mark Salsbery18-Sep-08 6:34 
GeneralRe: BitBlt does not work in print preview [modified] Pin
theCPkid18-Sep-08 7:01
theCPkid18-Sep-08 7:01 
GeneralRe: BitBlt does not work in print preview Pin
Mark Salsbery18-Sep-08 7:25
Mark Salsbery18-Sep-08 7:25 
GeneralRe: BitBlt does not work in print preview Pin
theCPkid18-Sep-08 22:44
theCPkid18-Sep-08 22:44 
GeneralRe: BitBlt does not work in print preview Pin
Mark Salsbery19-Sep-08 5:17
Mark Salsbery19-Sep-08 5:17 
GeneralRe: BitBlt does not work in print preview Pin
theCPkid19-Sep-08 19:49
theCPkid19-Sep-08 19:49 
AnswerRe: BitBlt does not work in print preview Pin
Roger Allen18-Sep-08 14:37
Roger Allen18-Sep-08 14:37 
GeneralRe: BitBlt does not work in print preview Pin
theCPkid18-Sep-08 22:42
theCPkid18-Sep-08 22:42 
Roger Allen wrote:
but you have it reversed which makes me intrigued (and I have even come out of CP semi-retirment to answer )


Special thx for that.

Roger Allen wrote:
The first thing I would say is drop BitBlt altogether. its not guaranteed to be compatible with both display DCs and printer DCs. Your best option would be to switch to StretchDIBits, from memory this is compatible with all DC types.


yeah...as noted earlier, creating a DIB bitmap removes the problem with print preview but the application becomes very slow. Also, the image quality becomes very poor. You can see red, blue, green lines over the whole image.

Roger Allen wrote:
Try creating your comapatible DC directtly from the screen by passing NULL instead of pDC. If that fixes the issues then I would say its down to the preview DC supporting all the world transforms and your in effect drawing of the edge of the comaptible bitmap.


No, I tried that earlier...creating a dc for monitor in print preview mode does not work.

Anyway, what I did last night is to check whether the DC is of type CPreviewDC. If it is, then I directly draw on that dc instead of creating a memory dc for it. otherwise I create a memory DC in case of print and normal view mode. It works correctly.

Also, I am thinking of creating a smaller fixed size bitmap on which to draw and then StretchBlt it on whatever the size of actual DC. This will save me from creating a bitmap every time inside OnDraw as well as painting on larger DC. As of now, the applicaion is taking large CPU power and I am trying to find out various tools for profiling that can help me find bad code. Dead | X|

Thanks for your suggestion.
QuestionHow can i lock the internet from a C++ program Pin
SNArruda18-Sep-08 5:04
SNArruda18-Sep-08 5:04 
AnswerRe: How can i lock the internet from a C++ program Pin
David Crow18-Sep-08 5:21
David Crow18-Sep-08 5:21 
JokeRe: How can i lock the internet from a C++ program Pin
Iain Clarke, Warrior Programmer18-Sep-08 5:22
Iain Clarke, Warrior Programmer18-Sep-08 5:22 
AnswerRe: How can i lock the internet from a C++ program Pin
Bram van Kampen18-Sep-08 14:55
Bram van Kampen18-Sep-08 14:55 
QuestionRatio result placing a square not working - when resizing window Pin
simon alec smith18-Sep-08 5:01
simon alec smith18-Sep-08 5:01 
QuestionRe: Ratio result placing a square not working - when resizing window Pin
David Crow18-Sep-08 5:26
David Crow18-Sep-08 5:26 
AnswerRe: Ratio result placing a square not working - when resizing window Pin
simon alec smith18-Sep-08 5:30
simon alec smith18-Sep-08 5:30 
AnswerRe: Ratio result placing a square not working - when resizing window [modified] Pin
Iain Clarke, Warrior Programmer18-Sep-08 5:29
Iain Clarke, Warrior Programmer18-Sep-08 5:29 
AnswerRe: Ratio result placing a square not working - when resizing window Pin
Mark Salsbery18-Sep-08 5:56
Mark Salsbery18-Sep-08 5:56 
QuestionWinInet issue Pin
George_George18-Sep-08 4:16
George_George18-Sep-08 4:16 
QuestionDrawing wider dashed lines Pin
softwaremonkey18-Sep-08 2:18
softwaremonkey18-Sep-08 2:18 
AnswerRe: Drawing wider dashed lines Pin
Cedric Moonen18-Sep-08 2:35
Cedric Moonen18-Sep-08 2:35 
GeneralRe: Drawing wider dashed lines Pin
softwaremonkey18-Sep-08 4:44
softwaremonkey18-Sep-08 4:44 
QuestionCSpinButtonControl : undeclared identifier. Pin
tenwang18-Sep-08 2:09
tenwang18-Sep-08 2:09 
AnswerRe: CSpinButtonControl : undeclared identifier. Pin
tenwang18-Sep-08 2:11
tenwang18-Sep-08 2:11 
AnswerRe: CSpinButtonControl : undeclared identifier. Pin
KarstenK18-Sep-08 2:13
mveKarstenK18-Sep-08 2:13 
GeneralRe: CSpinButtonControl : undeclared identifier. Pin
tenwang18-Sep-08 2:19
tenwang18-Sep-08 2:19 

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.