3个回答
展开全部
用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.
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.
展开全部
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
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
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
int ReleaseDC(HWND hWnd,HDC hDC);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询