public ColorSlider(ColorSliderMode colorMode) { _colorMode = colorMode; _baseColor = new ColorHLS(255, 255, 0, 0); _currentColor = _baseColor.Clone(); _previusColor = _baseColor.Clone(); this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.FixedHeight | ControlStyles.FixedWidth | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); this.Size = new System.Drawing.Size(20, 256); _cursorRect = new Rectangle(0, 256-4, 20, 7); _onDrag = false; _pixBuffer = new PixelBuffer(20, 256); FillBuffer(); this.Invalidate(); }
public ColorPicker() { _baseColor = new ColorHLS(255,255, 0, 0); _currentColor = _baseColor.Clone(); _previusColor = _baseColor.Clone(); this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.FixedHeight | ControlStyles.FixedWidth | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); this.Size = new System.Drawing.Size(256, 256); _cursorRect = new Rectangle(252, -3, 9, 9); _onDrag = false; _pixBuffer = new PixelBuffer(256, 256); FillBuffer(); MouseEvent(new MouseEventArgs(MouseButtons.Left, 1, _cursorRect.X + 4, _cursorRect.Y + 4, 0)); }