Asp Image

F

friddou

Guest
Hi Everebody,

Someone can to use Asp Image. I have a problem for resizing the image. I can to resize the image of large 2000 px. I used Asp Image 2 the serverobjects.
 
heres the one I just finished, also using persits upload, hope you can use it

Code:
<%
myF=500 'Full Image Size
myPath="D:\PathToMySitesImageFolder\images\"

'---------Upload Image-------------------------------------
Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.Save myPath
myImage=Upload.files.item("Image").filename

strFile = myPath&myImage
'----------------------------------------------------------

'---------------Image--------------------------------------
Set Image = Server.CreateObject("AspImage.Image")
Image.LoadImage(strFile)

WidthF = image.MaxX
HeightF = image.MaxY
  
if (WidthF<myF) and (HeightF<myF) then
else
  if WidthF>HeightF then
   intRatio=(myF/WidthF)
   image.resizeR WidthF*intRatio, HeightF*intRatio
  else
   intRatio=(myF/HeightF)
   image.resizeR WidthF*intRatio, HeightF*intRatio
  end if
end if

Image.ImageFormat = 1 'format 1=jpg
Image.JPEGQuality = 85 'percent
Image.FileName = strFile
Image.SaveImage

Set Image = Nothing
'---------------------------------------------------------
Set Upload = Nothing
%>
 
Back
Top