通过本文主要向大家介绍了vbscript,vbscript教程,vbscript是什么,vbscript.dll,vbscript下载等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
| Property | Type | Access | Description |
|---|---|---|---|
| Handle | OLE_HANDLE (int) | R | The Windows GDI handle of the picture |
| hPal | OLE_HANDLE (int) | RW | The Windows handle of the palette used by the picture. |
| Type | short | R | The type of picture (see PICTYPE). |
| Width | OLE_XSIZE_HIMETRIC (long) | R | The width of the picture. |
| Height | OLE_YSIZE_HIMETRIC (long) | R | The height of the picture. |
我们只关心Width和Height,它们分别表示图片的宽和高,但是它们的单位不是像素(Pixel),而是Himetric,我们要做的是把Himetric换算成Pixel。
首先把Himetric换算成英寸(Inch),1 Himetric = 0.01 mm,1 Inch = 2.54 cm,所以1 Inch = 2540 Himetric。
然后从Inch换算成Pixel,1 Inch等于多少Pixel呢?这是由系统的DPI(Dot Per Inch)设置决定的,默认值是96。
现在知道2540和96是怎么来的了吧?不过上面的代码存在两个问题:第一,使用了2540/96的近似值,可能会有误差;第二,使用了DPI的默认值96,而DPI的值是可以在控制面板中修改的。
VBS中LoadPicture函数的正确用法是:
</div>

