public BitmapSelector()
{
InitializeComponent();
//http://inchoatethoughts.com/custom-drawing-controls-in-c-manual-double-buffering
this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.SupportsTransparentBackColor, false);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
backbufferContext = BufferedGraphicsManager.Current;
Layers = new List<Layer>();
BrushLayerIndex = AddLayer(new Layer(this.Width, this.Height, 0.6f));
SelectionLayerIndex = AddLayer(new Layer(this.Width, this.Height, 0.6f, true));
ToolTips = new String[Width, Height];
scrollHorizontal.Maximum = Width;
scrollVertical.Maximum = Height;
}