Just wondering if there is a way to populate an ImageList from a Resource file. I have looked around on the web, but everything seems to have been from back in 2003/2005.
Any advice would be appreciated thanks in advance.
Here is an example of reading all images in a resource into an ImageList.
var dynamicImageList = new ImageList();
var resourceSet = MyResourceClass.ResourceManager.GetResourceSet(CultureInfo.InvariantCulture, true, false);
if (resourceSet != null)
{
foreach (DictionaryEntry entry in resourceSet)
{
var value = entry.Value as Bitmap; //only get images
if (value != null)
{
dynamicImageList.Images.Add((string) entry.Key, value);
}
}
}