[RESOLVED] Problem with savefiledialog
Hi,
When I save my picturebox no matter what the background colour is, it gets set to black. Does anyone know why it is doing this?
Here is the saving code:
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim saveFileDialog1 As New SaveFileDialog()
saveFileDialog1.Filter = "JPeg Image|*.jpg"
saveFileDialog1.Title = "Save an Image File"
saveFileDialog1.ShowDialog()
If saveFileDialog1.FileName <> "" Then
Dim fs As System.IO.FileStream = CType _
(saveFileDialog1.OpenFile(), System.IO.FileStream)
Select Case saveFileDialog1.FilterIndex
Case 1
Me.PictureBox1.Image.Save(fs, _
System.Drawing.Imaging.ImageFormat.Jpeg)
End Select
fs.Close()
End If
End Sub
The rest of this of the code is basically just comboboxes and a little reset code.
Thanks in Advance
Re: Problem with savefiledialog
Re: Problem with savefiledialog
I tried it, but when i had saved it, the saved picture just showed up as an error icon in picture manager.
Re: Problem with savefiledialog
Re: Problem with savefiledialog
Thanks, that has helped.
It has got rid of the black, but it does that by not saving the background, is there a way to get it to save the background color.
Re: Problem with savefiledialog
OK, what I then would advise you, is to fill the background of the picture box, as a rectangle, to the same dimensions of the height and witdh of the picturebox.
Then save!
I'm attaching a project for you, it's update especially for you!
Have a look at the Background Button, it changes the picturebox's background to blue Note that the 248 specified there is 248 for the height and 248 for the width of the picturebox.
Click save. Open the picture, your background will be blue.
have fun!
Re: Problem with savefiledialog
Thanks, I've got it working now
Re: Problem with savefiledialog