[기타] [vb.net] VB.NET에서 이미지 GUID를 사용하여 이미지 유형 확인
하나를하더라도최선을
2020-05-23 16:55
7,916
0
본문
Dim FormetType As String = String.Empty
If image.RawFormat.Guid = System.Drawing.Imaging.ImageFormat.Tiff.Guid Then
FormetType = "TIFF"
ElseIf image.RawFormat.Guid = System.Drawing.Imaging.ImageFormat.Gif.Guid Then
FormetType = "GIF"
ElseIf image.RawFormat.Guid = System.Drawing.Imaging.ImageFormat.Jpeg.Guid Then
FormetType = "JPG"
ElseIf image.RawFormat.Guid = System.Drawing.Imaging.ImageFormat.Bmp.Guid Then
FormetType = "BMP"
ElseIf image.RawFormat.Guid = System.Drawing.Imaging.ImageFormat.Png.Guid Then
FormetType = "PNG"
ElseIf image.RawFormat.Guid = System.Drawing.Imaging.ImageFormat.Icon.Guid Then
FormetType = "ICO"
Else
Throw New System.ArgumentException("Invalid File Type")
End If
image.Dispose()
댓글목록0