/// <summary> /// Fetches an image of the requested size. /// </summary> /// <param name="size">Size of image to obtain.</param> /// <returns>If supported, returns requested image. A value of null /// indicates that the requested size is not supported.</returns> public virtual Image GetImage(ShengToolStripImageSize size) { if (DefaultImageProvider == null) throw new NullReferenceException(); if (DefaultImageProvider == this) { Size iconSize = ShengToolStripIconImageProvider.GetIconSize(size); Bitmap icon = new Bitmap(16, 16); Icon iconResult = new Icon(DrawingTool.ImageToIcon(icon), iconSize); return iconResult.ToBitmap(); } return DefaultImageProvider.GetImage(size); }
/// <summary> /// Fetches an image of the requested size. /// </summary> /// <param name="size">Size of image to obtain.</param> /// <returns>If supported, returns requested image. A value of null /// indicates that the requested size is not supported.</returns> public virtual Image GetImage(ImageSize size) { if (DefaultImageProvider == null) { throw new NullReferenceException(); } if (DefaultImageProvider == this) { Size iconSize = IconImageProvider.GetIconSize(size); Icon iconResult = null;// new Icon(Resources.stop, iconSize); return(iconResult.ToBitmap()); } return(DefaultImageProvider.GetImage(size)); }