• Advertisement

Archived

This topic is now archived and is closed to further replies.

Windows GDI Mapping Mode

This topic is 5861 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am pretty new to windows programming. I am using MFC. I am trying to create a graphing program. There is only one problem. I need coordinate (0, 0) to be in the center of the screen, instead of the top left hand corner. Is there a mapping mode for this? If you know, please give me the code to do this. Thanks David

Share this post


Link to post
Share on other sites
Advertisement
Hmm, I don''t think mapping modes are correct solutions for this. Try CDC::SetViewPortOrg().

Share this post


Link to post
Share on other sites

The "mapping mode" actually has something to do with how the
coordinates are specified within the window.

Example: MM_TEXT, MM_LOENGLISH..etc

If you want (0,0) to be at the center of the window, why
don''t you find out the size of the window and just translate
everything accordingly? Probably easier.


Premature optimizations can only slow down your project even more.

Share this post


Link to post
Share on other sites
Right place for this would be OnPrepareDC(), which is called before OnDraw() (or OnPaint()).

Share this post


Link to post
Share on other sites

  • Advertisement