public DrawMode(ColorRegion cr)
 {
     Start = new Point();
     Stop  = new Point();
     Down  = false;
     Pen   = new Pen(cr.Color);
     CR    = cr;
     CR.BackColorChanged += CR_BackColorChanged;
 }
예제 #2
0
 public ColorPicker()
 {
     Rows              = 2;
     Columns           = 10;
     SelectableColours = new ColorRegion[Rows, Columns];
     //------ Primary and secondary colours -------
     PrimaryColor = new ColorRegion(this, Color.Black, 30, 30, 5, 5);
     this.Controls.Add(this.PrimaryColor);
     SecondaryColor = new ColorRegion(this, Color.White, 30, 30, 20, 20);
     this.Controls.Add(this.SecondaryColor);
     //------ Selectable colours -------
     for (int i = 0; i < Rows; i++)
     {
         for (int j = 0; j < Columns; j++)
         {
             SelectableColours[i, j] = new ColorRegion(this, defaultColors[i, j], 20, 20, 5 + (25 * i), 60 + (25 * j));
             this.Controls.Add(SelectableColours[i, j]);
         }
     }
     BorderStyle = BorderStyle.Fixed3D;
     InitializeComponent();
 }