你好,
感谢您在MSDN中文论坛发帖提问。
>>MFC 资源视图编辑对话框如何显示对话框的实际像素
在资源编辑器中使用的是对话框单位,这取决于使用的对话框字体和大小。
我建议你可以尝试使用GetDialogBaseUnits函数来检索系统的对话框基本单位,即系统字体中字符的平均宽度和高度。对于使用系统字体的对话框,可以使用这些值在对话框模板单元(在对话框模板中指定)和像素之间进行转换。对于不使用系统字体的对话框,从对话框模板单位到像素的转换取决于对话框使用的字体。
然后再使用MapDialogRect函数将指定的对话框单位转换为屏幕单位(像素)。该函数将转换后的坐标替换为指定的RECT结构中的坐标。
Best Regards,
Jeanine
"Visual c++" forum will be migrating to a new home on
Microsoft Q&A !
We invite you to post new questions in the "Developing Universal Windows apps" forum’s new home on
Microsoft Q&A
!
For more information, please refer to the
sticky post.