Solved

Zoom to fit

Posted on 1998-08-25
3
369 Views
Last Modified: 2010-05-18
Anybody have any idea on how to do a zoom to fit. I would like to scale down my view to a printable size. Also where do I add in the code, in the on prepareprinting, onbeginpriniting or the onprint. How do I determine how much to scale down my view size by ?
0
Comment
Question by:manx
[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
3 Comments
 

Author Comment

by:manx
ID: 1171214
Just a clarification. I'm using MC VC++ 1.52 . That is 16 bit Win 3.1 Application.
0
 
LVL 2

Accepted Solution

by:
AlFa earned 50 total points
ID: 1171215
I think the OnPrepareDC is the best.
You can test the Isprinting function of CDC, change your window or/nd viewport origin change the map mode to MM_ISOTROPIC or MM_ANISOTROPIC to be able to use ScaleWindowExt or /and SetViewportExt to change the scale factor.
How to determine the right values is an other problem
0
 

Author Comment

by:manx
ID: 1171216
I am drawing a schematic using lines and curves in my view. Changing the mapping mode causes the schematic to dissappear.
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

688 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