Resize 메서드

이미지의 크기를 변경합니다.

형식

syntax
objImage.Resize(Width, Height, Method)

objImage

Required. Image 오브젝트

Width

Long. 변경할 이미지 가로 크기(픽셀)입니다.

Height

Long. 변경할 이미지 세로 크기(픽셀)입니다.

Method

Long. 이미지 변경에 사용될 알고리즘을 지정합니다. ItpModeBicubic, ItpModeBilinear, ItpModeNearestNeighbor 중 하나를 지정합니다.

설명

Height에 0을 지정할 경우 원본 이미지의 가로/세로 비율을 유지하면서 Width에 지정된 가로 크기에 맞춰 이미지를 변경합니다. Width에 0을 지정할 경우 원본 이미지의 가로/세로 비율을 유지하면서 Height에 따라 이미지가 변경됩니다

이미지가 확대 되거나 축소될 경우 이미지 품질에 손상이 발생합니다. 이를 최소화하기 위해 ItpModeBicubic, ItpModeBilinear 알고리즘을 사용합니다. ItpModeNearestNeighbor는 두 알고리즘에 비해 성능상의 이점은 있으나 품질이 떨어집니다.

예제

ASP
Dim Image, Status
Set Image = Server.CreateObject("TABSUpload4.Image")
Status = Image.Load("C:\Images\sample1.jpg")
If Status = Ok Then
    '이미지 가로 크기가 640보다 클 경우 크기를 640으로 줄인다.
    If Image.Width > 640 Then
        Image.Resize 640, 0, ItpModeBicubic
        Image.Save "C:\Images\resize.jpg", 100, True
    End If
    Image.Close
Else
    Response.Write "이미지 파일을 열 수 없습니다. 오류 코드: " & Status
End If

See Also

Other Resources