minigui:获取屏幕分辨率(GetGDCapability)

约定不等于承诺〃 2022-05-19 23:53 436阅读 0赞

MiniGUI下获取屏幕分辨率用
unsigned int GetGDCapability (HDC hdc, int iItem)

  1. // 屏幕宽度
  2. int screen_width = GetGDCapability(HDC_SCREEN,GDCAP_HPIXEL);
  3. // 屏幕高度
  4. 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

发表评论

表情:
评论列表 (有 0 条评论,436人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Python实现屏幕分辨率获取

    Python实现屏幕分辨率获取 随着智能设备的普及,屏幕分辨率已经成为了一个不可忽略的参数。在开发过程中,我们需要获取当前设备的屏幕分辨率大小。本文将介绍如何使用Python