- 1、本文档共10页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
检测屏幕分辨率和颜色(Detect screen resolution and color)
Category: VC++
Recommendation: * * *
Document popularity: 352
This weeks popularity: 3
Release date: 2007-5-8
Nanjing Naval Command Academy Huang Xiangming
Windows API (GetDeviceCaps) - function can provide background information about equipment widely, including screen resolution and color depth. GUI program design allows the graphic elements as abstract objects, regardless of hardware device settings and user selection. This is for the majority of cases, such as window screen and a typical device independent bitmap operation can meet. But in some special cases will be limited, programmers need other methods to obtain the relevant information of the actual situation of equipment. This paper introduces an application for screen resolution and color depth.
(GetDeviceCaps) -- a function
(GetDeviceCaps) - API function can be used to obtain a lot of information equipment, it will become the gateway application and device driver. The following is the prototype of it in wingdi.h int GetDeviceCaps (HDC: HDC, int, nIndex);
- the first parameter is related to detection equipment background, the second parameter represents the detection value. The specific function is described in detail in the Win32SDK file, this paper focuses on the two characteristics of the equipment associated with the display resolution (horizontal and vertical) and can display different color number. These values can be respectively by HORZRES, VERTRES and BITSPIXEL (GetDeviceCaps) to return to the second parameters. BITSPIXEL returns the description of a pixel color need to determine the actual number of color figures, as long as calculated by 2 as the return value of the exponent.
The following C code is given, the detection screen resolution and color depth:
DC initialization screen
HDC screenDC;
Int colorBits, xRes, yRes;
ScreenDC = CreateDC (DISPLAY, NULL, NULL, NULL);
Retrieval equipment
ColorBits = GetDeviceCaps (screenDC, BITSPIXEL);
XRes = GetDevi
您可能关注的文档
- 把准改革脉搏 同心攻坚克难(Reform of the quasi concentric pulse to overcome difficulties).doc
- 报刊经营新思路--便利店经营模式分析(New thinking of newspaper management -- Analysis of convenience store management mode).doc
- 用美剧学英语最全攻略(Learn English best on American TV series).doc
- 报刊搜集作文素材300篇三(The newspaper collects 300 compositions. Three).doc
- 报刊社名称中用不用书名号(Should the name of a newspaper agency be used without a book).doc
- 报业如何应对新媒体的挑战培训(How does the press respond to new media challenge training).doc
- 用销售网格图去管理你的市场(Manage your market with a sales grid).doc
- 报考复旦大学医学院内科学专业的经验教训(To register for the experience of internal medicine in Fudan University medical school).doc
- 彼得原理033(Peter principle 033).doc
- 彼得原理035(Peter principle 035).doc
- 建筑工程学院本科毕业设计(论文)实施细则7(Rules for the implementation of graduation design (Thesis) of Architectural Engineering College 7).doc
- 检查大赛策划方案(Check the competition plan).doc
- 检索课(Retrieval Course).doc
- 建筑工程预算精品课(Construction engineering budget excellent course).doc
- 检验科工作总结(Summary of laboratory work).doc
- 检影验光1(1 dioptoscopy).doc
- 建筑工程预算问题集(Construction project budget problem set).doc
- 检影验光2(2 dioptoscopy).doc
- 江安导游词(Jiangan tour guide word).doc
- 建筑工程知识详解16.17.18(Detailed knowledge of construction engineering 16.17.18).doc
最近下载
- 湖北武汉青山区2025届初三2月份网络联考试卷数学试题含解析.doc VIP
- 嵌入式系统课后习题部分答案1.pdf VIP
- 2025年甘肃省中考英语试题卷(含标准答案).docx
- ±12V直流稳压电源设计与仿真.docx VIP
- 年产15吨的替米沙坦原料药车间工艺设计--大学毕业设计.doc VIP
- 2025重庆高级人民法院招聘派遣制司法警察4人笔试备考试题及答案解析.docx VIP
- 五年级上英语教案Unit+8+At+Christmas+教学设计1译林版(三起).doc VIP
- 最新国家开放大学电大本科《护理伦理学》多项选择题题库及答案(试卷号:1303).doc VIP
- 职业中专高教版语文 上册、下册、拓展模块三册文学常识汇总.pdf VIP
- 殡葬业职业培训课件下载最新完整版本.pptx VIP
文档评论(0)