프로그래밍/ASP
이미지 파일 리사이즈
백룡화검
2009. 6. 4. 12:01
'이미지 리사이즈
Function f_imgResize(dir)
Const int_limitWidth = 600 '이미지 제한 가로사이즈
Dim int_orgWidth '원본 이미지가로
Dim str_dir '폴더명
dim str_p '이미지업로드
dim obj_fso '파일시스템오브젝
Dim str_dir_path '파일전체경로
Set obj_fso = Server.CreateObject("Scripting.FileSystemObject")
str_dir_path = Server.MapPath("\") & Replace(dir,"/","\")
if (obj_fso.FileExists(str_dir_path)) Then
str_dir = Server.MapPath (dir)
Set str_p = LoadPicture(str_dir) ' 원래이미지의사이즈가 리턴
int_orgWidth = CLng(CDbl(str_p.Width) * 24 / 635) ' CLng 의 라운드 오프 기능 이용
Set str_p = Nothing
If int_limitWidth < int_orgWidth Then
f_imgResize = int_limitWidth
Else
f_imgResize = int_orgWidth
End If
End if
Set obj_fso = nothing
End Function
Function f_imgResize(dir)
Const int_limitWidth = 600 '이미지 제한 가로사이즈
Dim int_orgWidth '원본 이미지가로
Dim str_dir '폴더명
dim str_p '이미지업로드
dim obj_fso '파일시스템오브젝
Dim str_dir_path '파일전체경로
Set obj_fso = Server.CreateObject("Scripting.FileSystemObject")
str_dir_path = Server.MapPath("\") & Replace(dir,"/","\")
if (obj_fso.FileExists(str_dir_path)) Then
str_dir = Server.MapPath (dir)
Set str_p = LoadPicture(str_dir) ' 원래이미지의사이즈가 리턴
int_orgWidth = CLng(CDbl(str_p.Width) * 24 / 635) ' CLng 의 라운드 오프 기능 이용
Set str_p = Nothing
If int_limitWidth < int_orgWidth Then
f_imgResize = int_limitWidth
Else
f_imgResize = int_orgWidth
End If
End if
Set obj_fso = nothing
End Function
[출처] ASP 이미지 리사이즈(LoadPicture 사용)|작성자 비밀