Resource problem

NicoVB

Centurion
Joined
Jan 2, 2002
Messages
160
Location
Belgium
I've added an image to the project and set it to 'Embedded Resource'. But how do I call this resource in code??

Greetz
 
I'm at work and don't have the code in front of me, but I've done this a lot at home and I will try to remember. I don't think you need any of the things Thinker mentioned, the IDE will perform the task that the two command-line tools he cited do.

Code:
Dim imgBlah As Image

imgBlah = Image.FromStream(Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream("mynamespace.myimage.bmp"))

Try that.
 
I actually find it easier. I use the Search option in the IDE and set the filter to Visual Basic and Related, then I can avoid getting results that aren't relevant (to a certain extent).
 
I find it easier as well. The whole nature of the .NET framework lends itself to a hierarchy that is easy to navigate and understand. Add that to the overall acceptable organization of MSDN in the first place as well as a search engine that often finds more than you asked for (whether this is good or bad depends on personal taste) you get a fairly nice help system.

-CL
 
Don't get me started on Microsoft Help 2.0. The whole xml/
namespace thing is very convoluted. I don't have any problem
with the interface (although the help viewer is only a temporary
one until MS releases the real help viewer).
 
Back
Top