|
-
Oct 21st, 2012, 07:10 PM
#1
Thread Starter
New Member
Why are my pictures that i load into a picture box blurry?
Ok so here's the thing. I got a great response from my last thread and you all were such a big help, so I'm back for more.
My new problem is this. Keeping this simple, say i have 2 forms.
on form1 I have a picturebox and a button. when you click on the picturebox, an openfiledialog opens and the user selects a picture from their computer which then loads into the picturebox. when you click on the button, a savefiledialog opens allowing the user to name and save the picture.
Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SaveFileDialog1.ShowDialog()
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
OpenFileDialog1.ShowDialog()
End Sub
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
PictureBox1.ImageLocation = OpenFileDialog1.FileName
End Sub
Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk
PictureBox1.Image.Save(SaveFileDialog1.FileName + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
form2.ImageList1.Images.Add(Me.PicBox1.Image)
End Sub
End Class
on form2 there is another picturebox, another button and an imagelist. when the user saves the picture from form1, the image is automatically loaded into the image list on form2. Now the user is supposed to click the button and the image from the imagelist is supposed to load into the picturebox. which it does.
Code:
Public Class form2
Dim count As Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PictureBox1.Image = ImageList1.Images.Item(count)
End Sub
End Class
now here's the problem: When i click on the button on form2 to load the image, it's REALLY blurry. the size and image are correct but its just really blurry.
eventually i want to create a "windows picture gallery" type thing. where the user clicks on the button and the first image loads from the image list. i will also have 2 more buttons to allow the user to go from 1 picture to the next. And the image list I'm using, i have the visible property set to false (i want it all done with buttons) but thats for another day (unless you want to help).
So can anyone tell my why my image is loading blurry? Should I not use the imagelist component to accomplish my goals? Any help is appriciated. thanks everyone!!
Brian
Tags for this Thread
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
|