网站首页  词典首页

请输入您要查询的函数:

 

术语 setmapmode
释义 SetMapMode
语法:
int SetMapMode(
__in HDC hdc,
__in int fnMapMode
);
SetMapMode函数
该SetMapMode函数设置指定的设备上下文映射模式。映射模式定义了使用的度量单位转换页到设备空间的单位空间单位,并确定了方向,该装置的X和Y轴。
参数
hdc [in]
一个句柄,设备上下文。
fnMapMode [in]
新的映射模式。此参数可以是下列值之一。
ValueMeaning
MM_ANISOTROPICLogical单位映射到任意单位,任意缩放轴。使用SetWindowExtEx和SetViewportExtEx功能来指定单位,方向和缩放。
MM_HIENGLISHEach逻辑单元映射到0.001英寸。正x是正确的,正y了。
MM_HIMETRICEach逻辑单元映射为0.01毫米。正x是正确的,正y了。
MM_ISOTROPICLogical单位映射到任意单位同等规模轴,也就是说,一个沿x轴,等于一单位沿y轴单位。使用SetWindowExtEx和SetViewportExtEx职能单位和指定的轴线方向。图形设备接口(GDI)作出必要调整,以确保x和保持相同的大小(当窗口程度设y单位,视将进行调整,以保持部队各向同性)。
MM_LOENGLISHEach逻辑单元映射到0.01英寸。正x是正确的,正y了。
MM_LOMETRICEach逻辑单元映射到0.1毫米。正x是正确的,正y了。
MM_TEXTEach逻辑单元映射到一个设备像素。正x是正确的,正y下降。
MM_TWIPSEach逻辑单元映射到一个打印机的20点(一千四百四十○分之一英寸,也称为缇)。正x是正确的,正y了。
返回值
如果函数成功,返回值标识上的映射模式。
如果函数失败,返回值是零。
备注
在MM_TEXT模式可以申请来港工作的设备像素,其规模从设备到设备各不相同。
该MM_HIENGLISH,MM_HIMETRIC,MM_LOENGLISH,MM_LOMETRIC和MM_TWIPS模式在物理(如英寸或毫米)有意义的单位绘图程序非常有用。
在MM_ISOTROPIC模式确保长宽比为1:1。
在MM_ANISOTROPIC模式允许的x坐标和y坐标独立调节。
实例
有关示例,请参阅使用空间和坐标转换。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
坐标空间和转换概述
坐标空间与变换函数
GetMapMode
SetViewportExtEx
SetViewportOrgEx
SetWindowExtEx
SetWindowOrgEx
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==SetMapMode Function
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.
Syntax
int SetMapMode(
__in HDC hdc,
__in int fnMapMode
);
Parameters
hdc [in]
A handle to the device context.
fnMapMode [in]
The new mapping mode. This parameter can be one of the following values.
ValueMeaning
MM_ANISOTROPICLogical units are mapped to arbitrary units with arbitrarily scaled axes. Use the SetWindowExtEx and SetViewportExtEx functions to specify the units, orientation, and scaling.
MM_HIENGLISHEach logical unit is mapped to 0.001 inch. Positive x is to the right; positive y is up.
MM_HIMETRICEach logical unit is mapped to 0.01 millimeter. Positive x is to the right; positive y is up.
MM_ISOTROPICLogical 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).
MM_LOENGLISHEach logical unit is mapped to 0.01 inch. Positive x is to the right; positive y is up.
MM_LOMETRICEach logical unit is mapped to 0.1 millimeter. Positive x is to the right; positive y is up.
MM_TEXTEach logical unit is mapped to one device pixel. Positive x is to the right; positive y is down.
MM_TWIPSEach 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.

Return Value
If the function succeeds, the return value identifies the previous mapping mode.
If the function fails, the return value is zero.
Remarks
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.
Examples
For an example, see Using Coordinate Spaces and Transformations .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
See Also
Coordinate Spaces and Transformations Overview
Coordinate Space and Transformation Functions
GetMapMode
SetViewportExtEx
SetViewportOrgEx
SetWindowExtEx
SetWindowOrgEx
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd162980(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:29:15