ResizeImg.vbs
Test system: Windows XP SP2 WSH 5.6, can run successfully on any operating system that has Windows Image Acquisition installed. Windows ME and XP have WIA installed by default.
Among them, Water lilies.jpg is the "Sample Picture" included with XP. Please make sure to copy Water lilies.jpg to the folder where the script is located when running the vbs script.
Next program exciting tips: Convert image format with vbs, webcam screenshots, character recognition, speech recognition... Those who are interested can join our QQ discussion group: 21154458. Note: This group only welcomes friends who are sincerely discussing and learning vbs, not for answering batch processing/vbs questions.
[ Last edited by electronixtar on 2006-10-24 at 11:23 PM ]
Set oImg = CreateObject("WIA.ImageFile")
Set oProc = CreateObject("WIA.ImageProcess")
oImg.LoadFile "Water lilies.jpg" 'Open the Water lilies.jpg in the current folder
oProc.Filters.Add oProc.FilterInfos("Scale").FilterID 'Add a Scale filter
oProc.Filters(1).Properties("MaximumWidth")="400" 'Define the new image width
oProc.Filters(1).Properties("MaximumHeight")="300" 'Define the new image height
Set oNewImg = oProc.Apply(oImg) 'Save the new image to the oNewImg object
oNewImg.SaveFile "New.jpg" 'Save the oNewImg object as an image
Test system: Windows XP SP2 WSH 5.6, can run successfully on any operating system that has Windows Image Acquisition installed. Windows ME and XP have WIA installed by default.
Among them, Water lilies.jpg is the "Sample Picture" included with XP. Please make sure to copy Water lilies.jpg to the folder where the script is located when running the vbs script.
Next program exciting tips: Convert image format with vbs, webcam screenshots, character recognition, speech recognition... Those who are interested can join our QQ discussion group: 21154458. Note: This group only welcomes friends who are sincerely discussing and learning vbs, not for answering batch processing/vbs questions.
[ Last edited by electronixtar on 2006-10-24 at 11:23 PM ]
Recent Ratings for This Post
( 3 in total)
Click for details
C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
