I would like to capture a picture from a video recording and save it into a folder. When i capture it for the second time, a problem stated that "A generic error occurred in GDI+". I have fully access right to the folder and the path of the folder is correct.
Below is my coding
PictureBox1 is picture box used to record video
picImage is another windows form used to capture picture
Private Sub ButtonFOTO_Click(sender As Object, e As EventArgs) Handles ButtonFOTO.Click
Capturer.picImage.Image = PictureBox1.Image
Capturer.Show()
Threading.Thread.Sleep(1000)
Capturer.ButtonGUARDAR.PerformClick()
End Sub
Public Class Capturer
Private Sub ButtonGUARDAR_Click(sender As Object, e As EventArgs) Handles ButtonGUARDAR.Click
Dim bm As Bitmap = New Bitmap(picImage.Image)
bm.Save("C:\Users\lim\Desktop\photo\picture\test11.jpg", Imaging.ImageFormat.Jpeg)
Me.Hide()
End Sub
End Class