USING THE SCALE FACTOR

Scaling with Windows usually involves using one of the scalable mapping modes, MM_ISOTROPIC or MM_ANISOTROPIC. By using one of these mapping modes you can get Windows to do most of the work. Unfortunately, it’s not as simple as just changing the mapping mode, because neither is supported by CScrollView. If you can get around that, however, you’re home and dry. You’ll use MM_ANISOTROPIC for reasons that you’ll see in a moment, so let’s first understand what’s involved in using this mapping mode.

Scalable Mapping Modes

There are two mapping modes that allow the mapping between logical coordinates and device coordinates to be altered, and these are the MM_ISOTROPIC and MM_ANISOTROPIC modes. The MM_ISOTROPIC mode forces the scaling factor for both the x- and y-axes to be the same, which has the advantage that your circles will always be circles. The disadvantage is that you can’t map a document to fit into a rectangle of a different aspect ratio. The MM_ANISOTROPIC mode, on the other hand, permits scaling of each axis independently. Because it’s the more flexible mode of the two, you’ll use MM_ANISOTROPIC for scaling operations in Sketcher.

Just to remind you:

  • Logical coordinates (also referred to as page coordinates) are determined by the mapping mode. For example, the MM_LOENGLISH mapping mode has logical coordinates in units of 0.01 inches, with the origin in the upper-left corner of the client area, and the positive y-axis direction running from bottom to ...

Get Ivor Horton's Beginning Visual C++ 2012 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.