Large exe when compiled

sjn78

Junior Contributor
Joined
May 4, 2003
Messages
255
Location
Australia
I started my program with the intention of not using any graphics, ie icons in toolbars. But now I have decided to use them. They are all stored in imagelists, except the icons for the forms.

The program is no where near complete and it jumped from around 100k to now 600k since using icons.

At this rate, I believe it will probably end up around 10mb. I was just wondering what you guys think or recommend to do. Would it be better to contain all of the icons in a dll, therefore reducing the exe size.

Would this make the program run any quicker?? I guess the load time would be shorter. Or is there a way to have your icons in a folder and directly call them to be used in a toolbar?

Thanks for any assistance.
 
One alternative is to put certain forms in different assemblies, or even to enable localization so satellite assemblies are created. However I don't believe this will gain you any speed, so unless the resources are shared I don't really see the point.

Personally I use GIFs for toolbar images, I believe this might save some space. You could just have the images in a folder and load them in to the imagelist at runtime, if the EXE file size is important to you. 10mb does sound excessive, I have an application with a lot of toolbar images embedded and it doesn't come anywhere near even half a meg.
 
We put all of our core graphics into a separate assembly (project/DLL) which exposes them as resources. You get them by a string name, which is generally the original filename minus extension but wouldn't have to be. They're called like GetBitmap("mainlogobig") and GetIcon("exclamation3").

That way you an add more later without breaking any interfaces or version numbers but you can separate out the graphics. Just another idea.

-Ner
 
I like DLLs :)

I'm going to try that real quick, brb...

aahh! Ok I created an Assembly Resource File, it's Embedded...am I going the right way for a DLL? And plus I don't understand this:
 

Attachments

Check out Bucky's response in this thread.

Once you know how to load a bitmap from your EXE, you can expose a static method in a class in your DLL that let's you pull out the filename dynamically. If you need help with that, let me know.

-Ner
 
Back
Top