调用 GetDC(NULL) 返回什么类型的 DC?
What type of DC is returned by calling GetDC(NULL)?
WindowsAPI函数GetDC()
接受一个参数:
hWnd
A handle to the window whose DC is to be retrieved. If this value is NULL, GetDC retrieves the DC for the entire screen.
在页面的下方,注意到以下内容:
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.
不幸的是,不清楚调用 ReleaseDC()
是否需要屏幕 DC,因为它的类型在任何地方都没有提到。事实上,this page 描述了五种类型的 DC;但是 none 其中提到了 "screen".
我需要在屏幕 DC 上调用 ReleaseDC()
吗?
屏幕 DC 不是 class DC,也不是私有 DC,所以是的 - 它需要发布。
WindowsAPI函数GetDC()
接受一个参数:
hWnd
A handle to the window whose DC is to be retrieved. If this value is NULL, GetDC retrieves the DC for the entire screen.
在页面的下方,注意到以下内容:
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 calledGetDC
. The number of DCs is limited only by available memory.
不幸的是,不清楚调用 ReleaseDC()
是否需要屏幕 DC,因为它的类型在任何地方都没有提到。事实上,this page 描述了五种类型的 DC;但是 none 其中提到了 "screen".
我需要在屏幕 DC 上调用 ReleaseDC()
吗?
屏幕 DC 不是 class DC,也不是私有 DC,所以是的 - 它需要发布。