用getDC(0)获得屏幕DC后,如何释放.

对不起,忘了说了.我学的是VB,屏幕!!,不是其它场景... 对不起,忘了说了.我学的是VB,
屏幕!!,不是其它场景
展开
 我来答
砂粒312
高粉答主

推荐于2016-11-13 · 醉心答题,欢迎关注
知道大有可为答主
回答量:3.5万
采纳率:96%
帮助的人:6415万
展开全部
用getDC(0)获得屏幕DC后,释放方法:

After painting with a common device context, the ReleaseDC function must be called to release the device context.

This function releases a device context (DC), freeing it for use by other applications. The effect of ReleaseDC depends on the type of device context.

int ReleaseDC(
HWND hWnd,
HDC hDC
);
Parameters
hWnd
Handle to the window whose device context is to be released.
hDC
Handle to the device context to be released.
Return Values
The return value specifies whether the device context is released.

1 indicates that the device context is released.

Zero indicates that the device context is not released.

Remarks
The application must call the ReleaseDC function for each call to the GetWindowDC function and for each call to the GetDC function that retrieves a common device context.

An application cannot use the ReleaseDC function to release a device context that was created by calling the CreateDC function; instead, it must use the DeleteDC function.

Requirements
OS Versions: Windows CE 1.0 and later.
Header: Winuser.h.
Link Library: Coredll.lib, Winmgr.lib.
板圳幻舌漂21
推荐于2016-04-28 · TA获得超过222个赞
知道答主
回答量:186
采纳率:0%
帮助的人:0
展开全部
After painting with a common device context, the ReleaseDC function must be called to release the device context.

This function releases a device context (DC), freeing it for use by other applications. The effect of ReleaseDC depends on the type of device context.

int ReleaseDC(
HWND hWnd,
HDC hDC
);
Parameters
hWnd
Handle to the window whose device context is to be released.
hDC
Handle to the device context to be released.
Return Values
The return value specifies whether the device context is released.

1 indicates that the device context is released.

Zero indicates that the device context is not released.

Remarks
The application must call the ReleaseDC function for each call to the GetWindowDC function and for each call to the GetDC function that retrieves a common device context.

An application cannot use the ReleaseDC function to release a device context that was created by calling the CreateDC function; instead, it must use the DeleteDC function.

Requirements
OS Versions: Windows CE 1.0 and later.
Header: Winuser.h.
Link Library: Coredll.lib, Winmgr.lib.

//这跟你学的什么语言有什么关系,,API一样可以调用啊,,
只要是getDC返回的,,,都可以用 ReleaseDC 释放,,
屏幕的句柄为0,,所以ReleaseDC的时候第一个参数也为0

参考资料: MSDN

本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
newghost_joe
2007-02-10 · TA获得超过791个赞
知道小有建树答主
回答量:1915
采纳率:0%
帮助的人:1128万
展开全部
int ReleaseDC(HWND hWnd,HDC hDC);
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式