Solved

How can the scale (zoom in/out) be changed?

Posted on 1997-11-04
2
631 Views
Last Modified: 2013-11-20
How can the scale (zoom in/out) be changed?

I am trying to change the 'scale' of  drawn images (lines, rectangles…).I have tried using ScaleViewportExt() and ScaleWindowExt() in combination with MapMode(MM_ANISOTROPIC), SetWindowOrg(), SetWindowExt(), SetViewportOrg() and SetViewportExt(), but have had no luck -my image remains unchanged. Any help dealing with drawings using the CClientDC would be a great, thanks.
0
Comment
Question by:Malek103197
2 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1309379
The following code scales 2 times in X direction and 5 times in Y direction.

CClientDC dc(this);

dc.SetMapMode(MM_ANISOTROPIC);
dc.SetWindowExt(1, 1);
dc.SetViewportExt(2, 5);

// your drawing code
...

0
 

Author Comment

by:Malek103197
ID: 1309380
The basic concept provided in the answer is correct, but I still had to adddress the issue of changing the origin as the scale changes, otherwise the image would "walk" across the screen. Thanks for the help.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 42
countEvens challenge 2 112
withoutTen challenge 14 132
x-bar in Google Sheets 2 72
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question