|
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
namespace CommonTools
{
class ImagesUtil
{
static public ImageList GetToolbarImageList(Type type, string resourceName, Size imageSize, Color transparentColor)
{
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(type, resourceName);
ImageList imageList = new ImageList();
imageList.ImageSize = imageSize;
imageList.TransparentColor = transparentColor;
imageList.Images.AddStrip(bitmap);
imageList.ColorDepth = ColorDepth.Depth24Bit;
return imageList;
}
}
class SelectorImages
{
public enum eIndexes
{
Right,
Left,
Up,
Down,
Donut,
}
static private ImageList m_imageList = null;
static public ImageList ImageList()
{
Type t = typeof(SelectorImages);
if (m_imageList == null)
m_imageList = ImagesUtil.GetToolbarImageList(t, "ColorPickerCtrl.Resources.colorbarIndicators.bmp", new Size(12, 12), Color.Magenta);
return m_imageList;
}
static public Image Image(eIndexes index)
{
return ImageList().Images[(int)index];
}
}
class PopupContainerImages
{
public enum eIndexes
{
Close,
Check,
}
static private ImageList m_imageList = null;
static public ImageList ImageList()
{
Type t = typeof(SelectorImages);
if (m_imageList == null)
m_imageList = ImagesUtil.GetToolbarImageList(t, "ColorPickerCtrl.Resources.popupcontainerbuttons.bmp", new Size(16, 16), Color.Magenta);
return m_imageList;
}
static public Image Image(eIndexes index)
{
return ImageList().Images[(int)index];
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.