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()