PLEASE PLEASE PLEASE HELP, Embedding images and icons.
-
Hi I have posted this problem before, it is about embedding images or icons into your exe. I have been told to use an image list or changing the image/icon to embedded resources. But the code to retrieve them doesnt quite work. Can any body provide code to retrieve the image/icon back from changing it into an embeded resource or from using an image list. Thanks Vu
-
Hi I have posted this problem before, it is about embedding images or icons into your exe. I have been told to use an image list or changing the image/icon to embedded resources. But the code to retrieve them doesnt quite work. Can any body provide code to retrieve the image/icon back from changing it into an embeded resource or from using an image list. Thanks Vu
First, lookup 'ResEditor' in the Visual Studio documentation. You'll have to compile this little tool and use it to create a .resources file with your image information in it. Simple Add an image, give it a resource name, then click on the little '...' button and point it at image file that it is going to represent. Keep adding names and resources... then save this file as a .resources file in your project folder. Next, add the .resources file to your project in the Solution Explorer. Then in your code, you can use something like this: (This is the initialization code for a component I'm writing)
Private m\_img\_LightOn As Image Private m\_img\_LightOff As Image
#Region " Windows Form Designer generated code "
.
.
**' Load our internal resource files
Dim thisAssembly As System.Reflection.Assembly = Me.GetType.AssemblyDim resManager As New System.Resources.ResourceManager( "BinaryDisplay.BinaryDisplay", thisAssembly )
m_img_LightOn = CType(resManager.GetObject("BMP_LIGHTON"), System.Drawing.Image)
m_img_LightOff = CType(resManager.GetObject("BMP_LIGHTOFF"), System.Drawing.Image)** End SubRageInTheMachine9532