前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >minigui:获取屏幕分辨率(GetGDCapability)

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

作者头像
10km
发布2019-05-25 20:57:15
1.4K0
发布2019-05-25 20:57:15
举报
文章被收录于专栏:10km的专栏10km的专栏

版权声明:本文为博主原创文章,转载请注明源地址。 https://cloud.tencent.com/developer/article/1433482

MiniGUI下获取屏幕分辨率用

unsigned int GetGDCapability (HDC hdc, int iItem)

代码语言:javascript
复制
// 屏幕宽度
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

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018年07月09日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档