saving image from picturebox using savefile dialog problem please hep
I have the following code in VB 2010:
'>>>>>CODE FOR SAVING THE CAPTURED IMAGE<<<<<
Private Sub btnSaveSpecimen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Hand开发者_高级运维les btnSaveSpecimen.Click
'Saves the Image Captured
Dim Result As DialogResult 'variable declarations
Dim cap_image As Image
'opens a save dialog box for saving the settings
Result = savCaptured.ShowDialog
If Result = DialogResult.OK Then
cap_image = picSpecimen.Image
cap_image.Save(savCaptured.FileName, System.Drawing.Imaging.ImageFormat.Jpeg)
End If
End Sub
When I run the program, the following error occurs A generic error occurred in GDI+.
How can I resolve this?
please help me TYI
Most of the time when you encounter this error it's either one of two things. These are easy to rule out as the cause so you might want to consider doing that before looking elsewhere.
You attempt to write a file to a directory that you don't have Permission for.
You are trying to write back an image that you still have open.
精彩评论