| Change Image File Format .NET |
|
|
|
| Tutorials | |||
|
Using VB.NEt you can change a images file format. Use the code below:
[code]
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
[/code]
|


