C# and the Icon Class
-
Hi, I am currently developing a toolstrip extension which will provide a feature to switch between several different icon sizes. I cannot assume that a provided
Icon
object will contain the required size, and so in such circumstances the next available size down must be enlarged at runtime. My only issue is in determining whether or not theIcon
object contains the requested size. The following pseudo-code demonstrates what I am trying to achieve:public bool IconContainsSize(Icon icon, Size size)
{
foreach (subicon in icon)
if (subicon.Size == size)
return true;
return false;
}Once I have finished my extension I plan to upload an article here at CodeProject so that others can benefit from having a toolstrip which provides a facility to switch between the multiple button sizes provided within the programmer specified icon resources. This is literally the only part of my solution that I am struggling with! I am sure that there must be a .NET approach to this. :~ Thanks, Lea Hayes