Exemplo n.º 1
0
        private void buttonPreview_Click(object sender, EventArgs e)
        {
            Color color = Color.FromArgb((byte)numericUpDownAlpha.Value, colorDialog1.Color);
            int   width = (int)numericUpDownWidth.Value;

            pen = new My_Pen(color, width, (DashStyle)comboBoxDashStyle.SelectedItem);

            if (checkBoxEnableEndCap.Checked == true)
            {
                int     e_width  = (int)numericUpDownEndCapWidth.Value;
                int     e_height = (int)numericUpDownEndCapHeight.Value;
                LineCap l_cap    = (LineCap)comboBoxEndBaseCap.SelectedItem;

                My_ArrowCap cap = new My_ArrowCap(l_cap, e_width, e_height);
                pen.cap1 = cap;
            }

            if (checkBoxEnableStartCap.Checked == true)
            {
                int     s_width  = (int)numericUpDownSrartCapWidth.Value;
                int     s_height = (int)numericUpDownStartCapHeight.Value;
                LineCap l_cap    = (LineCap)comboBoxStartBaseCap.SelectedItem;

                My_ArrowCap cap = new My_ArrowCap(l_cap, s_width, s_height);
                pen.cap2 = cap;
            }
            pictureBoxPreview.Invalidate();
        }
Exemplo n.º 2
0
 public My_Pen(Color Color, int Width, DashStyle DashStyle, My_ArrowCap cap1, My_ArrowCap cap2)
 {
     this.Color     = Color;
     this.Width     = Width;
     this.DashStyle = DashStyle;
     this.cap1      = cap1;
     this.cap2      = cap2;
 }