|
-
Sep 20th, 2010, 06:48 PM
#1
Thread Starter
Addicted Member
Open a Jpeg
Could somebody show me how to open a Jpeg in a PictureBox by using a control button which takes you to an "Open" dialog which allows you to select the picture?
-
Sep 20th, 2010, 06:54 PM
#2
Re: Open a Jpeg
What did you find when you researched this? And what didn't work like you expected it to?
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Sep 20th, 2010, 06:55 PM
#3
Re: Open a Jpeg
try this:
vb Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ofd As New OpenFileDialog
ofd.Filter = "Image Files|*.jpg;*.gif;*.bmp;*.png;*.jpeg|All Files|*.*"
If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
picturebox1.image = New Bitmap(ofd.FileName)
End If
End Sub
End Class
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Sep 20th, 2010, 06:58 PM
#4
Thread Starter
Addicted Member
-
Sep 20th, 2010, 08:36 PM
#5
Re: Open a Jpeg
 Originally Posted by weirddemon
What did you find when you researched this? And what didn't work like you expected it to?
This website, like others, is meant to help people. If you don't share your solution, how can others benefit from that knowledge?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Sep 20th, 2010, 10:07 PM
#6
Re: Open a Jpeg
 Originally Posted by .paul.
This website, like others, is meant to help people. If you don't share your solution, how can others benefit from that knowledge?
You're quoting me out of context. I didn't have the solution. I could have come up with a copy and paste solution, but why should I, when it's clear the OP hasn't attempted anything on his own yet? I wanted to help him reach it on his own and help fix the mistakes he made by actually learning and not copy and pasting.
There's a good chance he has no idea how that code works. He only knows that it does and that's all.
99% of the other members, including the mods, I think, would agree with me. I didn't withhold the information to hinder learning, which is what that quote was getting at. I didn't provide it, so that learning would progress, but it was in the best possible way.
But, since you did decide to quote me, it's important that others understand the context of that quote. This post is where it originated and it's clearly a very different situation.
Last edited by weirddemon; Sep 20th, 2010 at 10:20 PM.
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Sep 20th, 2010, 10:26 PM
#7
Re: Open a Jpeg
 Originally Posted by .paul.
This website, like others, is meant to help people. If you don't share your solution, how can others benefit from that knowledge?
Doing the thinking for people teaches them that they don't have to think for themselves. It might solve the immediate problem but it doesn't make them a better developer. Trying and failing is an important part of the learning process. Not trying and having someone else do it for you is not learning at all. Helping someone fix the code they've already tried is far more beneficial. It might take more time and more effort, but the reward is far greater. You may think you are, but you're not really doing people any great favour by providing cut and paste solutions with no explanation and no effort on their part, assuming that their goal is to become a better developer.
-
Sep 20th, 2010, 10:36 PM
#8
Thread Starter
Addicted Member
Re: Open a Jpeg
guys i did not mean to start a debate here. The bottom line is someone did post the code. It does work and after looking at the code i do understand what the different parts of it do. I realize that many posters would not take any time to understand the solution they are given and simply cut and paste it so i can understand your frustrations. I have posted a few other questions since asking this one and have included code snippets that i am working with.
Again i do thank you all for your help here.
-
Sep 20th, 2010, 11:00 PM
#9
Re: Open a Jpeg
That's fine, but I just Googled and found pretty much the same thing already one the web.
http://www.google.com.au/search?q=op...ient=firefox-a
That's pretty much what weirddemon was getting at : look first, ask questions later.
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
|