示例#1
0
        protected void Init()
        {
            SuspendLayout();
            this.DoubleBuffered = true;

            this.clientWidth  = ClientRectangle.Width;
            this.clientHeight = ClientRectangle.Height;

            this.selectedColor = Color.Red;
            this.drawStyle     = ColorSpaceDrawStyle.HSBHue;

            bmp = new Bitmap(clientWidth, clientHeight, PixelFormat.Format32bppArgb);

            mouseMoveTimer          = new Timer();
            mouseMoveTimer.Interval = 10;
            mouseMoveTimer.Tick    += new EventHandler(MouseMoveTimer_Tick);

            ClientSizeChanged += new EventHandler(ClientSizeChanged_Event);
            MouseDown         += new MouseEventHandler(MouseDown_Event);
            MouseEnter        += new EventHandler(MouseEnter_Event);
            MouseUp           += new MouseEventHandler(MouseUp_Event);
            Paint             += new PaintEventHandler(Paint_Event);

            ResumeLayout(false);
        }
示例#2
0
 private void InitializeComponent()
 {
     this.colorBox    = new ColorPickerBox();
     this.colorSlider = new ColorPickerSlider();
     this.SuspendLayout();
     //
     // colorBox
     //
     this.colorBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                   | System.Windows.Forms.AnchorStyles.Left)
                                                                  | System.Windows.Forms.AnchorStyles.Right)));
     this.colorBox.BorderStyle      = System.Windows.Forms.BorderStyle.FixedSingle;
     this.colorBox.CrosshairVisible = true;
     this.colorBox.DrawStyle        = ColorSpaceDrawStyle.HSBHue;
     this.colorBox.Location         = new System.Drawing.Point(0, 0);
     this.colorBox.Name             = "colorBox";
     this.colorBox.Size             = new System.Drawing.Size(258, 258);
     this.colorBox.TabIndex         = 0;
     //
     // colorSlider
     //
     this.colorSlider.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                     | System.Windows.Forms.AnchorStyles.Right)));
     this.colorSlider.BorderStyle      = System.Windows.Forms.BorderStyle.FixedSingle;
     this.colorSlider.CrosshairVisible = true;
     this.colorSlider.DrawStyle        = ColorSpaceDrawStyle.HSBHue;
     this.colorSlider.Location         = new System.Drawing.Point(257, 0);
     this.colorSlider.Name             = "colorSlider";
     this.colorSlider.Size             = new System.Drawing.Size(32, 258);
     this.colorSlider.TabIndex         = 1;
     //
     // ColorPicker
     //
     this.AutoSize = true;
     this.Controls.Add(this.colorBox);
     this.Controls.Add(this.colorSlider);
     this.Name = "ColorPicker";
     this.Size = new System.Drawing.Size(292, 261);
     this.ResumeLayout(false);
 }
示例#3
0
 public ColorEventArgs(COLOR color, ColorSpaceDrawStyle drawStyle)
 {
     Color     = color;
     DrawStyle = drawStyle;
 }