vbs下用Shell.Application獲取圖片分辨率
更新時間:2011年01月21日 23:41:05 作者:
昨天有人在博客里留言:獲取圖片分辨率也可以用Shell.Application,我比較喜歡用這個。
簡單Google了一下,未果,于是發(fā)郵件請教了一下,很快就有了回復(fù)。
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
復(fù)制代碼 代碼如下:
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
相關(guān)文章
用vbs實現(xiàn)返回 IP 配置數(shù)據(jù)
用vbs實現(xiàn)返回 IP 配置數(shù)據(jù)...2007-03-03VBS監(jiān)視網(wǎng)絡(luò)連接與斷開的代碼
監(jiān)視網(wǎng)絡(luò)連接與斷開,特殊情況下可能有點用,兩個VBS腳本均來自微軟官網(wǎng)2013-07-07用vbscript實現(xiàn)啟用 Caps Lock (大寫)鍵
用vbscript實現(xiàn)啟用 Caps Lock (大寫)鍵...2007-04-04用vbs將輸出內(nèi)容寫到屏幕以覆蓋當(dāng)前屏幕上的內(nèi)容的方法
用vbs將輸出內(nèi)容寫到屏幕以覆蓋當(dāng)前屏幕上的內(nèi)容的方法...2007-03-03網(wǎng)絡(luò)接口利用率監(jiān)控VBS腳本代碼(Windows)
監(jiān)測windows主機網(wǎng)絡(luò)接口利用率的vbs代碼,需要的朋友可以參考下。2011-12-12