The following example shows how to save the gmseBitmap bmp to a TIFF with LZW compression:
Public Function GetEncoderInfo(ByVal mimeType As String) As ImageCodecInfo
Dim j As Integer
Dim encoders() As ImageCodecInfo
encoders = ImageCodecInfo.GetImageEncoders()
For j = 0 To encoders.Length - 1
If encoders(j).MimeType = mimeType Then
Return encoders(j)
End If
Next
Return Nothing
End Function
Dim ci As System.Drawing.Imaging.ImageCodecInfo = GetEncoderInfo("image/tiff")
Dim eps As New EncoderParameters(1)
eps.Param(0) = New EncoderParameter(System.Drawing.Imaging.Encoder.Compression, EncoderValue.CompressionLZW)
bmp.Save(f, ci, eps)
|