The SetMapMode function sets the mapping mode of the specified device context. The mapping mode defines the unit of measure used to transform page-space units into device-space units, and also defines the orientation of the device’s x and y axes.
int SetMapMode(
HDC hdc, |
// handle of device context |
int fnMapMode |
// new mapping mode |
); |
Value |
Description |
MM_ANISOTROPIC |
Logical units are mapped to arbitrary units with arbitrarily scaled axes. Use the SetWindowExtEx and SetViewportExtEx functions to specify the units, orientation, and scaling that you want. |
MM_HIENGLISH |
Each logical unit is mapped to 0.001 inch. Positive x is to the right; positive y is up. |
MM_HIMETRIC |
Each logical unit is mapped to 0.01 millimeter. Positive x is to the right; positive y is up. |
MM_ISOTROPIC |
Logical units are mapped to arbitrary units with equally scaled axes; that is, one unit along the x-axis is equal to one unit along the y-axis. Use the SetWindowExtEx and SetViewportExtEx functions to specify the units and the orientation of the axes that you want. Graphics device interface (GDI) makes adjustments as necessary to ensure the x and y units remain the same size (for example, if you set the window extent, the viewport will be adjusted to keep the units isotropic). |
MM_LOENGLISH |
Each logical unit is mapped to 0.01 inch. Positive x is to the right; positive y is up. |
MM_LOMETRIC |
Each logical unit is mapped to 0.1 millimeter. Positive x is to the right; positive y is up. |
MM_TEXT |
Each logical unit is mapped to one device pixel. Positive x is to the right; positive y is down. |
MM_TWIPS |
Each logical unit is mapped to one twentieth of a printer’s point (1/1440 inch, also called a “twip”). Positive x is to the right; positive y is up. |
If the function succeeds, the return value identifies the previous mapping mode.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The MM_TEXT mode allows applications to work in device pixels, whose size varies from device to device.
The MM_HIENGLISH, MM_HIMETRIC, MM_LOENGLISH, MM_LOMETRIC, and MM_TWIPS modes are useful for applications drawing in physically meaningful units (such as inches or millimeters).
The MM_ISOTROPIC mode ensures a 1:1 aspect ratio.
The MM_ANISOTROPIC mode allows the x-coordinates and y-coordinates to be adjusted independently.
GetMapMode, SetViewportExtEx, SetViewportOrgEx, SetWindowExtEx, SetWindowOrgEx
file: /Techref/os/win/api/win32/func/src/f79_15.htm, 5KB, , updated: 2000/4/7 11:19, local time: 2024/12/30 11:59,
18.220.196.68:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/techref/os/win/api/win32/func/src/f79_15.htm"> SetMapMode</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232! |
.