Logical and Physical Coordinate RelationshipLast reviewed: July 22, 1997Article ID: Q74044 |
3.00 3.10
WINDOWS
kbprg
The information in this article applies to:
SUMMARYWindows is designed to use a logical coordinate system when doing many of its graphics operations. Many of the Windows functions take logical units as parameters. Windows translates these units to physical device units based on the mapping mode of the device, window origin, window extents, viewport origin, and viewport extents. This article discusses the relationship between logical and physical coordinates.
MORE INFORMATIONThe default mapping mode for a device context (DC) is the MM_TEXT mode. The point (0,0) is the origin of the logical and physical coordinate systems in this mode. It also has a 1 to 1 mapping ratio of logical to physical device units. The programmer can change the mapping mode of a DC by using the SetMapMode() function. The following six mapping modes have predefined logical to physical mapping ratios:
The formulae used to convert to and from the different coordinate systems are documented in section 2.5.3, page 2-18, in the "Microsoft Windows Software Development Kit Reference Volume 1" for version 3.0.
REFERENCESFor more information about the relationship between the logical and physical planes, refer to the following: "Microsoft Windows Software Development Kit Reference Volume 1" version 3.0, section 2.5 "Mapping Functions," pages 2-15 through 2-20. "Programming Windows," first edition, by Charles Petzold Chapter 12, pages 520-540."Programming Windows," second edition, by Charles Petzold Chapter 11, pages 517-539."Peter Norton's Windows 3.0 Power Programming Techniques," by Peter Norton and Paul Yao, Chapter 20, c. 1990, Bantam Books. |
Additional reference words: 3.00 3.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |