dlu 坐标单位 与 像数 的映射

 

DialogLayout is a simple layout manager which works with what the Win32

// API calls "dialog logical units" (DLUs). DLUs are resolution independent

// coordinates which work well for laying out controls on a dialog box. The

// mapping from DLUs to pixels is based on the font in use in the dialog box.

// An x-coordinate DLU is described as 1/4 (.25) of the of the average character

// width of the font used in the dialog. A y-coordinate DLU is described as

// 1/8 (.125) of the character height used in the dialog. One tricky issue to

// note: The average character width is not the average of all characters --

// rather it is the average of all alpha characters both uppercase and

// lowercase. That is, it is the extent of the string "a...zA...Z" divided

// by 52.

/*DialogLayout类是一个简单的布置管理器,用来配合Win32 API中的对话框逻辑单位(DLU)工作。对话框逻辑单位是与分辨率无关的坐标单位,它对于对话框中控制部件的布置很有作用。从DLU到象素有一个映射,此映射是基于对话框所用的字体的。DLU的一个X方向的坐标单位相当于对话框中所用字体的平均宽度的1/4,Y方向的坐标单位相当于对话框对话框所用字体高度的1/8。注意字体平均宽度的计算并非是所有字符的平均,而是字母a…z(包括大写)的宽度的平均,换句话说,它等于字符串”a…zA…Z”的长度除以52。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值