هدا الكود اخدته من برنامج وهو شغال كويس في البرنامج لكن لمن انسخه و احطه في مشرعي ما بضبط
بس بفتح مربع الحوار لكن مابحدد نوع الصورة و لمن احفظ الصورة ما بتنحفظ يا ريت اللي بعرف السبب
يقلي الخطأ
Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
If picMain.Image Is Nothing Then
MsgBox("Drop an image file first !", MsgBoxStyle.Exclamation Or MsgBoxStyle.ApplicationModal, "No Image")
Return
End If
dlgSave.ShowDialog()
If dlgSave.FileName = "" Then Return
Dim imgFormat As Imaging.ImageFormat
If (dlgSave.FileName.EndsWith("png")) Then imgFormat = Imaging.ImageFormat.Png
If (dlgSave.FileName.EndsWith("jpg")) Then imgFormat = Imaging.ImageFormat.Jpeg
If (dlgSave.FileName.EndsWith("bmp")) Then imgFormat = Imaging.ImageFormat.Bmp
If (dlgSave.FileName.EndsWith("gif")) Then imgFormat = Imaging.ImageFormat.Gif
If (dlgSave.FileName.EndsWith("tga")) Then imgFormat = Imaging.ImageFormat.Tiff
Try
picMain.Image.Save(dlgSave.FileName, imgFormat)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical Or MsgBoxStyle.ApplicationModal, "Error")
End Try