В GDI+ произошла общая ошибка. VB.NET при сохранении изображения из picturebox
пожалуйста, предоставьте мне решение для следующего кода, который показывает ошибку GDI+ на рис.save.
Public Class Form1<br /> Dim open As OpenFileDialog<br /> Dim i As String<br /> Dim img As Image = Nothing<br /> Dim pic As String<br /> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br /> End Sub<br /> <br /> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br /> open = New OpenFileDialog<br /> open.Filter = "Image Files(*.jpg;*.jpeg;*.gif;*.bmp;*.png;*.tif)|*.jpg;*.gif;*.bmp;*.tif"<br /> open.ShowDialog()<br /> pic = open.FileName<br /> Try<br /> Dim fs As New System.IO.FileStream(pic, IO.FileMode.Open, IO.FileAccess.Read)<br /> img = Image.FromStream(fs)<br /> fs.Close()<br /> fs.Dispose()<br /> My.Computer.FileSystem.DeleteFile(pic)<br /> emppic.Image = img<br /> Catch ex As Exception<br /> img = Nothing<br /> End Try<br /> End Sub<br /> <br /> Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click<br /> Dim img6 As Image<br /> img6 = emppic.Image<br /> Try<br /> emppic.Image.Save("C:\C-tek\Images\Temp\1.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)<br /> Catch ex As Exception<br /> MsgBox("File Saving Error." + ex.ToString)<br /> End Try<br /> End Sub<br /> End Class
вами заранее