Option Explicit
'By Demon
'http://demon.tw
Dim p
Set p = LoadPicture("F:\curve.jpg")
WScript.Echo "Width: " & Himetric2Pixel(p.Width)
WScript.Echo "Height: " & Himetric2Pixel(p.Height)
Function Himetric2Pixel(n)
'1 Inch = 2540 Himetric
Const key = "HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics\AppliedDPI"
Dim WshShell, dpi
Set WshShell = WScript.CreateObject("Wscript.Shell")
dpi = WshShell.RegRead(key)
Himetric2Pixel = Round(n * dpi / 2540)
End Function
EXCLE vba 读取图片尺寸
最新推荐文章于 2024-03-21 19:02:20 发布