通过GetClientRect的Rect单位是多少 [英] what is the unit of Rect via GetClientRect
本文介绍了通过GetClientRect的Rect单位是多少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我通过GetClientRect得到一个矩形,令我惊讶的是:
rect.width = 1401,但是我的屏幕是1366 * 768。rect.width的单位是什么?是英寸还是其他?
I get a rect by GetClientRect,to my suprise is below:
rect.width=1401 ,however my screen is 1366*768 .What is the unit of rect.width? Is it inch or other?
推荐答案
发布评论中嵌入的(我的)解决方案...用户已更改映射模式 [ ^ ]因此逻辑坐标不再与设备单元匹配。
更改映射到MM_TEXT使两个测量结果一致。
一些参考资料:
GDI制图 [ ^ ]
设备无关的像素 [ ^ ]
协调空间和转换 [ ^ ]
Posting (my) solution embedded in the comments ... User had changed the mapping mode[^] so the Logical co-ordinates no longer matched the device units.
Changing the mapping to MM_TEXT brought the two measurements into line.
Some reference material:
GDI Mapping[^]
Device Independent Pixels[^]
Co-ordinate spaces and Transformation[^]
它在像素中。看起来你的Windows比屏幕大。检查设置大小的位置。
it is in pixel. Looks like your Windows is bigger than the screen. Check where you set the size.
这篇关于通过GetClientRect的Rect单位是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文