Solved

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

Posted on 1997-11-04
2
589 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
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

10 Experts available now in Live!

Get 1:1 Help Now