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.
- hdc [in]
A handle to the device context.
- fnMapMode [in]
The new mapping mode. This parameter can be one of the following values.
Each logical unit is mapped to 0.001 inch. Positive x is to the right; positive y is up.
Each logical unit is mapped to 0.01 millimeter. Positive x is to the right; positive y is up.
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. Graphics device interface (GDI) makes adjustments as necessary to ensure the x and y units remain the same size (When the window extent is set, the viewport will be adjusted to keep the units isotropic).
Each logical unit is mapped to 0.01 inch. Positive x is to the right; positive y is up.
Each logical unit is mapped to 0.1 millimeter. Positive x is to the right; positive y is up.
Each logical unit is mapped to one device pixel. Positive x is to the right; positive y is down.
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.
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.
For an example, see Using Coordinate Spaces and Transformations.
Minimum supported client
|Windows 2000 Professional [desktop apps only]|
Minimum supported server
|Windows 2000 Server [desktop apps only]|
- Coordinate Spaces and Transformations Overview
- Coordinate Space and Transformation Functions
Build date: 6/12/2013