网站首页  词典首页

请输入您要查询的函数:

 

术语 setgraphicsmode
释义 SetGraphicsMode
语法:
int SetGraphicsMode(
__in HDC hdc,
__in int iMode
);
SetGraphicsMode功能
该SetGraphicsMode函数设置为指定的设备环境的图形模式。
参数
hdc [in]
一个句柄,设备上下文。
iMode的 [in]
图形模式。此参数可以是下列值之一。
ValueMeaning
GM_COMPATIBLESets图形模式是与16位Windows兼容。这是默认模式。如果此值指定,应用程序只能修改世界到设备改造通过调用该设置窗口和视程度和来源的功能,但不是通过SetWorldTransform或ModifyWorldTransform,调用这些函数将失败。该设置窗口和视程度和来源的例子包括SetViewportExtEx和SetWindowExtEx。
GM_ADVANCEDSets先进的图形模式,让世界的转变。此值必须指定如果应用程序将设置或修改为指定的设备上下文世界的改造。在这种模式下所有的图形,包括文字输出,完全符合世界到设备改造设备上下文指定。
返回值
如果函数成功,返回值是旧的图形模式。
如果函数失败,返回值是零。
备注
有三个领域图形输出根据不同的图形模式:
文本输出:在模式的GM_COMPATIBLE,TrueType字体(或矢量字体)输出文本大致相同的行为方式方面的光栅世界字体文本输出到在DC转换器。该TrueType文本总是书面从左到右,右侧时,即使图形其余的会翻转X或Y轴。只有的TrueType(或矢量字体)文本高度缩放。唯一的方法编写的文本中没有横向的GM_COMPATIBLE模式是指定在该设备上下文的逻辑字体选择非零纵和方向。
在GM_ADVANCED模式,TrueType字体(或矢量字体)文本输出完全符合世界对在设备方面的设备改造。光栅字体只有非常有限的转换能力(拉伸一些整数因素)。图形设备接口(GDI)尝试生产可以转换为平凡的光栅字体的最佳输出。
矩形排除:如果默认的GM_COMPATIBLE图形模式设置,系统不包括最右边的底部和边缘时,它绘制矩形。
在GM_ADVANCED图形模式则需要申请要绘制矩形的右下角包容性。
电弧图:如果默认的GM_COMPATIBLE图形模式设置,GDI的绘制弧使用该设备目前的太空弧方向。本公约,弧不尊重页到设备的转换,需要沿翻转X或Y轴。
如果GM_ADVANCED图形模式设置,GDI总是在绘制在逻辑空间逆时针方向弧线。这等于声明,在GM_ADVANCED图形模式下,电弧弧控制点和充分尊重自己的设备上下文的世界到设备的改造。
实例
有关示例,请参阅使用空间和坐标转换。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
坐标空间和转换概述
坐标空间与变换函数
CreateDC
GetArcDirection
GetDC
GetGraphicsMode
ModifyWorldTransform
SetArcDirection
SetViewportExtent
SetViewportExtEx
SetWindowExtent
SetWindowExtEx
SetWorldTransform
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==SetGraphicsMode Function
The SetGraphicsMode function sets the graphics mode for the specified device context.
Syntax
int SetGraphicsMode(
__in HDC hdc,
__in int iMode
);
Parameters
hdc [in]
A handle to the device context.
iMode [in]
The graphics mode. This parameter can be one of the following values.
ValueMeaning
GM_COMPATIBLESets the graphics mode that is compatible with 16-bit Windows. This is the default mode. If this value is specified, the application can only modify the world-to-device transform by calling functions that set window and viewport extents and origins, but not by using SetWorldTransform or ModifyWorldTransform ; calls to those functions will fail. Examples of functions that set window and viewport extents and origins are SetViewportExtEx and SetWindowExtEx .
GM_ADVANCEDSets the advanced graphics mode that allows world transformations. This value must be specified if the application will set or modify the world transformation for the specified device context. In this mode all graphics, including text output, fully conform to the world-to-device transformation specified in the device context.

Return Value
If the function succeeds, the return value is the old graphics mode.
If the function fails, the return value is zero.
Remarks
There are three areas in which graphics output differs according to the graphics mode:
Text Output: In the GM_COMPATIBLE mode, TrueType (or vector font) text output behaves much the same way as raster font text output with respect to the world-to-device transformations in the DC. The TrueType text is always written from left to right and right side up, even if the rest of the graphics will be flipped on the x or y axis. Only the height of the TrueType (or vector font) text is scaled. The only way to write text that is not horizontal in the GM_COMPATIBLE mode is to specify nonzero escapement and orientation for the logical font selected in this device context.
In the GM_ADVANCED mode, TrueType (or vector font) text output fully conforms to the world-to-device transformation in the device context. The raster fonts only have very limited transformation capabilities (stretching by some integer factors). Graphics device interface (GDI) tries to produce the best output it can with raster fonts for nontrivial transformations.
Rectangle Exclusion: If the default GM_COMPATIBLE graphics mode is set, the system excludes bottom and rightmost edges when it draws rectangles.
The GM_ADVANCED graphics mode is required if applications want to draw rectangles that are bottom-right inclusive.
Arc Drawing: If the default GM_COMPATIBLE graphics mode is set, GDI draws arcs using the current arc direction in the device space. With this convention, arcs do not respect page-to-device transforms that require a flip along the x or y axis.
If the GM_ADVANCED graphics mode is set, GDI always draws arcs in the counterclockwise direction in logical space. This is equivalent to the statement that, in the GM_ADVANCED graphics mode, both arc control points and arcs themselves fully respect the device context's world-to-device transformation.
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
CreateDC
GetArcDirection
GetDC
GetGraphicsMode
ModifyWorldTransform
SetArcDirection
SetViewportExtent
SetViewportExtEx
SetWindowExtent
SetWindowExtEx
SetWorldTransform
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd162977(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 13:17:13