网站首页  词典首页

请输入您要查询的函数:

 

术语 getdc
释义 GetDC
语法:
HDC GetDC(
__in HWND hWnd
);
GetDC函数
GetDC函数检索句柄设备上下文的指定窗口的工作区(区)或整个屏幕。您可以使用返回的GDI函数在随后的处理,引入直流。设备上下文是一个不透明的数据结构,其值由GDI内部使用。
该GetDCEx功能是对GetDC,这使得一个应用程序更好地控制如何以及是否延长剪辑在客户区发生。
参数
hWnd [in]
一个句柄,窗口的DC是要检索。如果此值为NULL,GetDC检索整个屏幕的DC。
返回值
如果函数成功,返回值是一个句柄指定的窗口客户区的区议会。
如果函数失败,返回值为NULL。
备注
GetDC函数检索一个共同的,阶级,取决于指定的窗口类的样式或私人直流。对于阶层和私人区,GetDC离开以前分配的属性不变。然而,共同的议会,GetDC默认属性分配到DC每次检索的时间。例如,默认字体为System,这是一个位图字体。正因为如此,在处理一个共同的区议会补选GetDC返回并没有告诉您什么字体,颜色,用刷或当窗口被提请。要确定字体,请GetTextFace。
请注意,处理到DC只能由一个线程使用在任何一个时间。
在与一个共同的议会,ReleaseDC函数必须调用释放直流画。阶层和私人议会没有被释放。 ReleaseDC必须调用的线程中调用GetDC。区议会的数量只受可用内存。
实例
有关示例,请使用鼠标绘制。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinuser.h(头文件:winuser.h)
LibraryUser32.lib
DLLUser32.dll
参见
设备上下文概述
设备上下文函数
GetDCEx
ReleaseDC
GetTextFace
GetWindowDC
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==GetDC Function
The GetDC function retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the DC. The device context is an opaque data structure, whose values are used internally by GDI.
The GetDCEx function is an extension to GetDC, which gives an application more control over how and whether clipping occurs in the client area.
Syntax
HDC GetDC(
__in HWND hWnd
);
Parameters
hWnd [in]
A handle to the window whose DC is to be retrieved. If this value is NULL, GetDC retrieves the DC for the entire screen.
Return Value
If the function succeeds, the return value is a handle to the DC for the specified window's client area.
If the function fails, the return value is NULL.
Remarks
The GetDC function retrieves a common, class, or private DC depending on the class style of the specified window. For class and private DCs, GetDC leaves the previously assigned attributes unchanged. However, for common DCs, GetDC assigns default attributes to the DC each time it is retrieved. For example, the default font is System, which is a bitmap font. Because of this, the handle to a common DC returned by GetDC does not tell you what font, color, or brush was used when the window was drawn. To determine the font, call GetTextFace .
Note that the handle to the DC can only be used by a single thread at any one time.
After painting with a common DC, the ReleaseDC function must be called to release the DC. Class and private DCs do not have to be released. ReleaseDC must be called from the same thread that called GetDC. The number of DCs is limited only by available memory.
Examples
For an example, see Drawing with the Mouse .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinuser.h (include Windows.h)
LibraryUser32.lib
DLLUser32.dll
See Also
Device Contexts Overview
Device Context Functions
GetDCEx
ReleaseDC
GetTextFace
GetWindowDC
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd144871(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:54