|
-
July 19th, 2006, 05:34 AM
#1
[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
Last edited by Splatch; July 20th, 2006 at 08:31 AM.
-
July 19th, 2006, 06:13 AM
#2
Re: Problem with savefiledialog
-
July 19th, 2006, 06:30 AM
#3
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.
-
July 19th, 2006, 06:44 AM
#4
Re: Problem with savefiledialog
-
July 19th, 2006, 07:02 AM
#5
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.
-
July 19th, 2006, 07:26 AM
#6
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!
Last edited by HanneSThEGreaT; December 19th, 2008 at 03:08 AM.
-
July 19th, 2006, 09:59 AM
#7
Re: Problem with savefiledialog
Thanks, I've got it working now
-
July 19th, 2006, 10:06 AM
#8
Re: Problem with savefiledialog
You're welcome!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|