Help - DLL's, Images, and loading them ^-^

Kayot

Well-known member
Joined
Mar 6, 2007
Messages
49
Programming Experience
3-5
Overview
So far, my program uses external icons that are loaded from a sub dir lower than the program is located in. The code used to display them is as follows

imgArray(loopint).Image = Image.FromFile(“SubDir\” & reader.getstring(1) & “.gif”)

The reader.getstring(1) is an integer from the SQL Database (unrelated to this question)

Objective
I would like to put all the gif files into a single DLL and still be able to use them the same way as above. The only command even remotely related is as follows:

Global.ProgramNameSpace.My.Resources.NameofResource

The above code does not allow integers to be used. It is a static line. And requires the files to be placed in the Exe. Therefore, here is what I want to know.

Goal
I would like to use a DLL to store the graphic files. I would like to use those graphics in the program. I do not want to put the graphics in the main EXE as it is still under development and if I can externalize the graphics, it would save on upload speeds. Any help would be much appreciated. Google is not helping at all.
 
A DLL more or less a compiled version of your form. Create a member variable (or enumerated one) for each image. Set the variable to the location of the image and use a protected readonly ????() function to return the image.

Unless this DLL is a requirement it would be far easier to use them as a resource. Go to project, properties, resources. Add Resource, Add existing file. Add all your images. The just call the image with my.resource.imageName
 
How would I use a load that could be dynamic?

Like with my current method

VB.NET:
   imgArray(loopint).Image = Image.FromFile(“SubDir\” & Loopint & “.gif”)
I can use a loaded number to build the image request. Is there a way to do that with resource files without a huge private sub?
 
Use one of the Get... methods of My.Resources.ResourceManager
 
Is there a way to merge a DLL with a program? I have a MySQL Dll and I was just wondering if it was possible.
 
Back
Top