We've been developing several WinForms projects for a client over the past year and have noticed that the projects are starting to use a common set of image resources (about 20) for controls like tool strip buttons, picture boxes, etc. Would it be considered good, acceptable or poor practice to embed these images in their own class library and provide a reference in each WinForms project, instead of continuing to embed them in directly in each WinForms project? Each WinForms project would use most of the images, but not necessarily all. Would there be any type of performance penalty for using the separate DLL for the images? Any thoughts on this would be appreciated. Many thanks, Paul
Asked
Active
Viewed 161 times
1 Answers
0
The resources are only loaded into memory as requested, meaning that you will pay for them by disk space but not by memory consumption or performance.
There is some overhead associated with the assembly itself (that you could avoid by using LOAD_LIBRARY_AS_DATAFILE
, considerably complicating this task), but this overhead is of no concern if the assembly contributes no code.
The change impacts your development processes more than the end product, which is typical of reuse. If you can say that it is the same team of people collectively managing all the applications, I see only good sides to this particular practice. You will just have to be a little more careful with versioning so that changes done for one application will not break another.

Jirka Hanika
- 13,301
- 3
- 46
- 75
-
Thank you very much for your thoughts Jirka; they are very helpful. Paul – PT83 Jul 05 '12 at 11:20