تغییر اندازه عکس با asp برای شما

amirlol

Well-Known Member
مدتی بود این سوال برام ایمیل شده بود
من خودم اینو بدون DLL نداشتم ولی آلان هستش می تونید استفاده کنید
شاد باشید



کد:
<%
dim iWidth, iHeight, iType 
sub ImgDimension(img) 
   dim myImg, fs 
   Set fs= CreateObject("Scripting.FileSystemObject") 
   if not fs.fileExists(img) then exit sub 
   set myImg = loadpicture(img) 
   iWidth = round(myImg.width / 26.4583) 
   iHeight = round(myImg.height / 26.4583) 
   iType = myImg.Type 
   select case iType 
   case 0 
       iType = "None" 
   case 1 
       iType = "Bitmap" 
   case 2 
       iType = "Metafile" 
   case 3 
       iType = "Icon" 
   case 4 
       iType = "Win32-enhanced metafile" 
   end select 
   set myImg = nothing 
end sub 

' so if you whant to test it in asp just give the path to your image 
ImgDimension(Server.MapPath("../.") & "\images\header.gif") 


response.write("Dimensions: " & iWidth & " x " & iHeight & "<br>") 
response.write("Image Type: " & iType & "<br>") 
%>
 

azartash

New Member
Error ميده:
Microsoft VBScript runtime (0x800A0046)
Permission denied: 'loadpicture'
/imagesize.asp, line 7
 

leg_big

Member
دوست عزیز شما باید پرمیژن system.directory هاست خودت رو باز کنی
 

جدیدترین ارسال ها

بالا