How to save image to your specific path?

By James J

Save image to given path in specific format...

'In ImageFormat there are other formates available like Bmp, Gif, Icon, Jpeg, Tiff etc...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim img1 As Image

'Path is given from the textbox1...
            img1 = Image.FromFile(TextBox1.Text)

''Save image as png format & named as 2.png in C drive...
            img1.Save("C:\2.Png", System.Drawing.Imaging.ImageFormat.Png)
Catch ex As Exception
End Try
End Sub

How to save image to your specific path?  (791 Views)