Pinting in MFC, what is the best way.
-
Hi all, What is the best way to print inside MFC (Visual 2002). I have tried TextOut but that sucks because every printer is different. I am getting the idea that MFC can't do a very good job of printer because of limited functions? hopefully, its my limited knowledge.
-
Hi all, What is the best way to print inside MFC (Visual 2002). I have tried TextOut but that sucks because every printer is different. I am getting the idea that MFC can't do a very good job of printer because of limited functions? hopefully, its my limited knowledge.
I'm sad to say that it is your limited knowledge :-) With
GetDeviceCaps
, you can get the resolution for the output media (be it screen or printer). You can use the value - compared with that of the screen - to scale your drawing and font creation. For text only, you can also create fonts in typographical points -CreatePointFont
andCreatePointFontIndirect
. Finally, you might want to set the mapping mode to one of the physical coordinate systems - seeSetMapMode
on MSDN. -
I'm sad to say that it is your limited knowledge :-) With
GetDeviceCaps
, you can get the resolution for the output media (be it screen or printer). You can use the value - compared with that of the screen - to scale your drawing and font creation. For text only, you can also create fonts in typographical points -CreatePointFont
andCreatePointFontIndirect
. Finally, you might want to set the mapping mode to one of the physical coordinate systems - seeSetMapMode
on MSDN.Hi Johan, Thank you for the support. I will be working on this problem this weekend. Sadly, printing is my weakest skills but this project will force me to be better. I guess I have put off printing long enough. Thnx again.
-
Hi Johan, Thank you for the support. I will be working on this problem this weekend. Sadly, printing is my weakest skills but this project will force me to be better. I guess I have put off printing long enough. Thnx again.
It's not much different from working with the screen, actually. The big problem is designing drawing code that makes no assumptions regarding the output resolution.