| Getting Started - Resizing images in ASP |
|
|
|
Example of using Image Console in ASP To make this work, Place the ImageConsole.exe in the current folder where the uploaded images reside. That is more convenient as the normal path of the ImageConsole.exe has spaces. For what I want, is to have 3 sizes of images, 50,170 and 300 pixels height. Create in the image folder 3 sub folders and name them 50,170 and 300. Create an asp page and add this code to run the ImageConsole.exe after the new images are uploaded. I tested it with JPG and GIF images and it works fine.
OPTION EXPLICIT strMemNumber = "0000028_1.JPG" strPath = lCase(Trim(server.MapPath("ImageConsole.exe"))) strPath = Trim(Replace(strPath,"imageconsole.exe","")) strExtension = UCase(right(strMemNumber,3)) Set WShShell = Server.CreateObject("WScript.Shell") 'Height = 50 runPath = strPath & "ImageConsole.exe /overwrite /resize /height:50 /type:" & strExtension & " " & strPath & strMemNumber & " " & strPath & "50" intres = WshShell.Run (RunPath,1,true) 'Height = 170 runPath = strPath & "ImageConsole.exe /overwrite /resize /height:170 /type:" & strExtension & " " & strPath & strMemNumber & " " & strPath & "170" intres = WshShell.Run (RunPath,1,true) 'Height = 300 runPath = strPath & "ImageConsole.exe /text /align:1 /textleft:0 /texttop:20 /red:247 /green:255 /blue:0 /font:" & chr(34) & "Times New Roman " & chr(34) & " /string:" & chr(34) & " intres = WshShell.Run (RunPath,1,true) Response.Write ("runPath = " & runPath & "<HR>") set WshShell = Nothing |
||

