Solved

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

Posted on 1997-11-04
2
658 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

617 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