I've created this save function but it doesn't work the way that it's supposed to. First of all, whenever I bring in an image, save it and open the saved image, nothing happens, this confuses me simply because a file IS created but contains nothing. Secondly, whenever I try to save the image as a TIFF, it constsntly says that the filenemae is invalid. Can anyone help me with this problem?
Code:
Private Sub FileSaveAs_Click(sender As System.Object, e As System.EventArgs) Handles FileSaveAs.Click
SaveFileDialog.AddExtension = True
SaveFileDialog.DefaultExt = Path.GetExtension(SaveFileDialog.FileName)
If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
Try
Select Case SaveFileDialog.FilterIndex
Case 1
picImage.Image.Save(SaveFileDialog.FileName,System.Drawing.Imaging.ImageFormat.Bmp)
Case 2
picImage.Image.Save(SaveFileDialog.FileName,System.Drawing.Imaging.ImageFormat.Gif)
Case 3
picImage.Image.Save(SaveFileDialog.FileName,System.Drawing.Imaging.ImageFormat.Jpeg)
Case 4
picImage.Image.Save(SaveFileDialog.FileName,System.Drawing.Imaging.ImageFormat.Png)
Case 5
picImage.Image.Save(SaveFileDialog.FileName,System.Drawing.Imaging.ImageFormat.Tiff)
End Select
Catch ex As Exception
MsgBox("There is no image to save.")
End Try
End If
End Sub