版权声明:本文为博主原创文章,转载请注明源地址。 https://cloud.tencent.com/developer/article/1433482
MiniGUI下获取屏幕分辨率用
unsigned int GetGDCapability (HDC hdc, int iItem)
// 屏幕宽度
int screen_width = GetGDCapability(HDC_SCREEN,GDCAP_HPIXEL);
// 屏幕高度
int screen_height =GetGDCapability(HDC_SCREEN,GDCAP_VPIXEL);
GetGDCapability
用于返回HDC的参数,如果hdc参数为HDC_SCREEN
,返回的就是屏幕DC的相关参数,不同的iItem值返回不同的参数:
GDCAP_COLORNUM Tell GetGDCapability to return the colors number of the DC. Note the for a DC with 32-bit depth, the function will return 0xFFFFFFFF, not 0x100000000. GDCAP_HPIXEL Tell GetGCapability to return the horizontal resolution of the DC. GDCAP_VPIXEL Tell GetGDCapability to return the vertical resolution of the DC. GDCAP_MAXX Tell GetGDCapability to return the maximal visible x value of the DC. GDCAP_MAXY Tell GetGDCapability to return the maximal visible y value of the DC. GDCAP_DEPTH Tell GetGDCapability to return the color depth of the DC. The returned value can be 1, 4, 8, 15, 16, 24, or 32. GDCAP_BITSPP Tell GetGDCapability to return the bits number for storing a pixle in the DC. GDCAP_BPP Tell GetGDCapability to return the bytes number for storing a pixle in the DC. GDCAP_RMASK Tell GetGDCapability to return the pixel red color mask for the DC. GDCAP_GMASK Tell GetGDCapability to return the pixel green color mask for the DC. GDCAP_BMASK Tell GetGDCapability to return the pixel blue color mask for the DC. GDCAP_AMASK Tell GetGDCapability to return the pixel alpha color mask for the DC. GDCAP_PITCH Tell GetGDCapability to return the pitch (the bytes of one scan line) of the DC.
官方API说明参见:
http://www.minigui.com/api_ref/3.0.12_processes/group__dc__fns.html