I need to save the background of Form2 to file. It looks like there is a problem with Access to the path for save. It throws the following exception:
A generic error occurred in GDI+
It works when running the application as Administrator, but the program must work without Admin rights.
Here's my code:
Dim sPath As New SaveFileDialog
sPath.DefaultExt = ".\"
Dim bmp As New Bitmap(Form2.BackgroundImage)
Try
'bmp = Form2.BackgroundImage
bmp.Save(sPath.FileName + "image.png", System.Drawing.Imaging.ImageFormat.Png)
Catch ex As Exception
MsgBox(ex.Message)
End Try