First, create a new form, switch to View Code mode, and inset these namespaces at the top of your document:
Imports System.Drawing.Imaging
Imports System.IO.Path
Switch back to the View Design mode, and add the following controls:
TextBox, name it as txtOriginal.
Button, name is as btnOpen
Butoon, name is as btnConvert
ListBox, name is as lbox
OpenFileDialog, name it as file
Add these items to the lbox ListBox:
Emf
Exif
Gif
Icon
MemoryBmp
Png
Tiff
Wmf
Add two labels as shown in the picture below.

Back to the View Code mode, add the following code:
Public Function ConvertImage(ByVal path As String, _
ByVal format As ImageFormat) As Boolean
Dim flag As Boolean
Dim nFile As String
Try
' create Bitmap variable to hold the old image
Dim vImage As New Bitmap(path)
' set new file directory name
nFile = GetDirectoryName(path)
'parse the file name without the extension
nFile &= "\" & GetFileNameWithoutExtension(path)
'add new extension to file
nFile &= "." & format.ToString
' save the file
vImage.Save(nFile, format)
flag = True
Catch ex As Exception
MsgBox(ex.Message)
flag = False
End Try
Return flag
End Function
btnOpen Click Event:
Private Sub btnOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpen.Click
file.ShowDialog()
End Sub
File FileOk Event:
Private Sub file_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles file.FileOk
Me.txtOriginal.Text = file.FileName
End Sub
btnConvert Click Event:
Private Sub btnConvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConvert.Click
Try
Select Case Me.lbox.SelectedItem
Case "Emf"
ConvertImage(Me.txtOriginal.Text, ImageFormat.Emf)
Case "Exif"
ConvertImage(txtOriginal.Text, ImageFormat.Exif)
Case "Gif"
ConvertImage(txtOriginal.Text, ImageFormat.Gif)
Case "Jpeg"
ConvertImage(txtOriginal.Text, ImageFormat.Jpeg)
Case "Icon"
ConvertImage(txtOriginal.Text, ImageFormat.Icon)
Case "MemoryBmp"
ConvertImage(txtOriginal.Text, ImageFormat.MemoryBmp)
Case "Png"
ConvertImage(txtOriginal.Text, ImageFormat.Png)
Case "Tiff"
ConvertImage(txtOriginal.Text, ImageFormat.Tiff)
Case "Wmf"
ConvertImage(txtOriginal.Text, ImageFormat.Wmf)
End Select
Catch ex As Exception
MsgBox(ex.Message)
Exit Sub
End Try
MsgBox("Image successfully converted")
End Sub
Happy coding!




