Forum Moderators: phranque
' start internet explorer with parameter(1) as page
' grab screen into picture001.jpg file name
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshShell2 = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("cmd /c del c:\upload\picture0?.jpg", 3)
Return = WshShell.Run("cmd /c del c:\upload\picture.jpg", 3)
Set Args = WScript.Arguments
Return = WshShell.Run("c:\progra~1\intern~1\iexplore.exe -k " & args(0), 3)
WshShell.AppActivate "Internet Explorer"
WScript.Sleep 14000
'There are 6 levels of the JPEG compression.
' jpgs = JPEG Superb
' jpgh = JPEG High
' jpgg = JPEG Good
' jpgn = JPEG Normal
' jpga = JPEG Average
' jpgb = JPEG Bad
WshShell2.Run("C:\Progra~1\Howies~1\HQScreen.exe 0 jpgs 24 picture c:\upload\ 1")
WScript.Sleep 1000
WshShell.SendKeys "%{F4}"
' load the created picture
' and resize
' and save as "picture.jpg"
Set ctrl = createobject("GflAx.GflAx")
ctrl.enablelzw = True
ctrl.LoadBitmap "c:\upload\picture001.jpg"
ctrl.Saveformat = 1 ' AX_JPEG
ctrl.ChangeColorDepth AX_ToTrueColors
imageheight = ctrl.height
imagewidth = ctrl.width
newheight = 250
newWidth = (newHeight * ctrl.Width) / ctrl.Height
ctrl.Resize newWidth, newHeight
ctrl.savebitmap "c:\upload\picture.jpg"
set ctrl=nothing
' delete original picture001.jpg file
Return = WshShell.Run("cmd /c del c:\upload\picture001.jpg", 3)