Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • *Gurus*
Posted

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.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

  • *Experts*
Posted

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 want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

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:

"Reality is fake, Dreams are for real"
  • *Experts*
Posted

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

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...