Solved

Zoom to fit

Posted on 1998-08-25
3
356 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
  • 2
3 Comments
 

Author Comment

by:manx
Comment Utility
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
Comment Utility
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
Comment Utility
I am drawing a schematic using lines and curves in my view. Changing the mapping mode causes the schematic to dissappear.
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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

763 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