Click or drag to resize

Load 메서드

이미지 파일을 읽습니다.

형식
syntax
Status = objImage.Load(FileName)

Status

Long. 이미지의 상태 코드를 반환합니다.

objImage

Required. Image 오브젝트

FileName

String. 읽을 이미지 파일을 지정합니다.

설명

파일 시스템에 저장되어 있는 이미지 파일을 메모리로 읽어 들입니다. 읽을 수 있는 파일 형식은 JPEG, PNG, BMP, GIF, TIFF 입니다. Animated GIF의 경우 첫 프레임 이미지만 로딩됩니다.

Load 호출 후 이미지가 올바르게 생성되었는지를 반환하는 Status 값을 반드시 검사해 Ok일 경우만 다음 단계로 진행해야 합니다. 이미지 사용이 끝나면 Close 메서드를 호출해서 메모리에서 해제하도록 합니다.

예제
ASP
Dim Image, Status
Set Image = Server.CreateObject("TABSUpload4.Image")
Status = Image.Load("C:\Images\sample1.jpg")
If Status = Ok Then
    Response.Write "Size: " & Image.Width & "x" & Image.Height
    ....
    Image.Close
Else
    Response.Write "이미지 파일을 열 수 없습니다. 오류 코드: " & Status
End If