Thursday, June 09, 2005 6:44 PM
I have created "Resources" project to store all resource information across projects like icons, images, string, messages, etc... This helps my team to develop application faster, more robust, easy to update resources, and most important, globalization supports.
To reduce overhead of the resources with an application interaction, I have created a simple
ArrayList
collection with a
singleton class. It loads all images and icons inside memory when application starts. (I know it occupies lots of memory, so I have to be really careful here. Also, Thanks to my colleague for his support).
When I set image/icon to any button/toolbar etc.. (mainly
Infragistics controls), it streaches icon/image to appropriate size to fit (16x16 pixels), which creates an horrible image !!
so I have "
google" few articles to find-out best way to resize an image with better quality. Using Window's GDI+ through .NET framework, I have created simple function ImageResize as follow:
This function also helps to create a thumbnail of the large images for web applications, which reduce network traffic and improve response-time.
At last, Good GDI+ FAQ with dotnet examples:
here.