vbs下用Shell.Application获取图片分辨率
程序员文章站
2022-08-27 15:28:39
简单google了一下,未果,于是发邮件请教了一下,很快就有了回复。 复制代码 代码如下: path = "c:\test.jpg" arr = split(path,"\...
简单google了一下,未果,于是发邮件请教了一下,很快就有了回复。
path = "c:\test.jpg"
arr = split(path,"\")
filename = arr(ubound(arr))
folderpath = left(path, len(path) - len(filename) - 1)
set objshell = createobject("shell.application")
set objfolder = objshell.namespace(folderpath)
set objfolderitem = objfolder.parsename(filename)
width = objfolder.getdetailsof(objfolderitem, 162)
height = objfolder.getdetailsof(objfolderitem, 164)
msgbox "width: " & width & " height: " & height
原文:http://demon.tw/programming/shell-application-picture-resolution.html
复制代码 代码如下:
path = "c:\test.jpg"
arr = split(path,"\")
filename = arr(ubound(arr))
folderpath = left(path, len(path) - len(filename) - 1)
set objshell = createobject("shell.application")
set objfolder = objshell.namespace(folderpath)
set objfolderitem = objfolder.parsename(filename)
width = objfolder.getdetailsof(objfolderitem, 162)
height = objfolder.getdetailsof(objfolderitem, 164)
msgbox "width: " & width & " height: " & height
原文:http://demon.tw/programming/shell-application-picture-resolution.html