Learning - trying to have a default image with the picturebox

*need quick*

Using VS 2005, vb.net I am trying to have a default image, an image loaded when nothing is selected yet, like onLoad. In the control box of psbCam1 I used the IntitialImage and I clicked the radio button for local resource, import and viola put my picture in but when I run the program it doesn't show. What am I doing wrong? Also I want this to be used with other users on their machine so maybe I am just going about this all wrong. Please help!
Kit_Kat111Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fruhjCommented:
Local resources are pretty cool - they get compiled in the app and you can use them without much worry about thier location.

I have a bunch of icons on my menus that way.

(PS speaking of icons, there's a bunch of them in a zip file located on your hard drive (visual studio 2005): C:\Program Files\Microsoft Visual Studio 8\Common7\VS2005ImageLibrary)

as far as the default picture,
I have one on my app, it's in a picture box, and the image property is set to System.drawing.bitmap (which I pulled from the (...) button on the right - mine says localresource)


0
Kit_Kat111Author Commented:
Thanks for response!
so in debug mode I won't see those pictures that I have as defaults?  I thought the system.drawing.bitmap were the error pictures you can associate with it?

ty
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
The InitialImage property is used to display something in the PictureBox "while the main image is loading":
http://msdn2.microsoft.com/en-us/library/system.windows.forms.picturebox.initialimage.aspx

I'm not sure of it's proper usage...but I think that would most likely be used when the main image is large and might take awhile to load so you could use InitialImage to display something smaller while the main image loads?  I can't think of an easy way to test this in a WinForms app.  Seems to be more appropriate for a web page...

If you want an Image to be there "by default" then set the Image property to your "initial image".  It will display and then you can change it at run-time via code in response to whatever event you want.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Kit_Kat111Author Commented:
Okay I did just that but didn't compile, the "default" image didn't show up in debug mode.
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
So you selected your PictureBox and then down in the Image property you clicked the ellipses (...) and used the "Import" button with a Local Resource?

For me the Image is visible in the IDE at design-time.

Try compiling.  If there are errors then the version you ran was an old one.
0
Kit_Kat111Author Commented:
Thanks for your response. That does sound logical. I will compile once I get this next section done, I just can't figure out how to set it up -maybe you can help?
0
Kit_Kat111Author Commented:
Okay I compiled and still no default pictures....
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
Something else is going on there...

What happens if you create a new project with just a picturebox in a form and set the pbs Image property?
0
klb37777Commented:
Well I tried the same thing on a different machine and it didn't work like I wanted. I thought the image would be there until another image was specifed like from a ddl or something, BUT I did figure out another solution. Quite simple in fact, just assigned the image like normal and when I select from ddl it changes it. Thanks for helping me.....
0
klb37777Commented:
The image was small. And since you and Fruhj helped me understand if I was doing this right I am going to split the points. Hope that is cool with you both, it seems fair to me. Thanks again for the help.
0
Kit_Kat111Author Commented:
Wow...that is an old log in from an old job. oops sorry. I will send an e-mail. That is what I get for logging into an different computer. Thanks again
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.