Solved

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

Posted on 1997-11-04
2
607 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 37
Named range not carried over 10 62
maxBlock challenge 30 112
Window placement 17 75
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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now