示例#1
0
        private void SelBrush_BrushSelected(object sender, EventArgs e)
        {
            curBrushBtn.BackgroundImage = selBrush.getImage();

            switch (selBrush.getBrush())
            {
            case 0:
                MarProp.BringToFront();
                Brushes_Label1.Text = "Marker";
                break;

            case 1:
                EraProp.BringToFront();
                Brushes_Label1.Text = "Eraser";
                break;

            case 2:
                FillProp.BringToFront();
                Brushes_Label1.Text = "Fill Can";
                break;

            case 3:
                PelProp.BringToFront();
                Brushes_Label1.Text = "Pencil";
                break;

            case 4:
                SprProp.BringToFront();
                Brushes_Label1.Text = "Spray Can";
                break;

            case 5:
                CalliProp.BringToFront();
                Brushes_Label1.Text = "Calligraphy Pen";
                break;
            }

            Brushes_Label1.Location = new Point((this.Width - Brushes_Label1.Width) / 2, Brushes_Label1.Location.Y);

            if (selBrush.Visible)
            {
                selBrush.Hide();
            }
            else
            {
                selBrush.Show();
            }
        }
示例#2
0
        public BrushesPanel()
        {
            InitializeComponent();

            // ResizeHelper.SetRevolution(curBrushBtn);

            selBrush          = new BrushesSelection();
            selBrush.Location = new Point(0, curBrushBtn.Location.Y + curBrushBtn.Size.Height + 10);
            selBrush.Size     = new Size(Width + 20, 220);
            selBrush.BringToFront();
            selBrush.Hide();

            Controls.Add(selBrush);
            MarProp.BringToFront();

            Brushes_Label1.Text     = "Marker";
            Brushes_Label1.Location = new Point(77, 8);
            curBrushBtn.Location    = new Point((this.Width - curBrushBtn.Width) / 2, curBrushBtn.Location.Y);

            selBrush.BrushSelected  += SelBrush_BrushSelected;
            colorPanel.StateChanged += ColorPanel_StateChanged;
        }