Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms
Imports System.Data
Imports System.Drawing.Imaging
public class MainClass
public Shared Sub Main
Dim imgCodecInfo As ImageCodecInfo = Nothing
Dim curBitmap As New Bitmap("yourfile.jpg")
Dim j As Integer
Dim mimeType As String = "image/png"
Dim encoders() As ImageCodecInfo
encoders = ImageCodecInfo.GetImageEncoders()
j = 0
While j < encoders.Length
If encoders(j).MimeType = mimeType Then
imgCodecInfo = encoders(j)
End If
End While
curBitmap.Save("yourfile.png", imgCodecInfo, Nothing)
curBitmap.Dispose()
End Sub
End class
|