21 | 08 | 2017

Change Image File Format .NET

Using VB.NEt you can change a images file format. Use the code below:
 Sub ConvertImageFormat(ByVal Picturepath As String, ByVal Picturename As String)
        Dim Image As Drawing.Image
        Image = Image.FromFile(Picturename) 'opens file in any format
        'save file
        image.Save(Picturepath, Drawing.Imaging.ImageFormat.Bmp) 'save to bmp format
        image.Save(Picturepath, Drawing.Imaging.ImageFormat.Jpeg) 'save to jpeg format
    End Sub

Sub TestImageConvertion()
        'below a string on how to test the convertion
        'change the picture path or imageformat to test more file formats
        ConvertImageFormat("C:\My Images\", "Testimage.Jpeg")
End Sub


Sign up now and upload your code to the website.

Help us to continue.....
Articles View Hits
Latest Articles