예제 #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();
        }
예제 #2
0
 public PenProperties(My_Figure figure, EntityDrawningCore core)
 {
     InitializeComponent();
     this.pen    = figure.pen;
     this.figure = figure;
     this.core   = core;
     LoadData();
 }
예제 #3
0
        public My_Text(EntityDrawningCore core) : base(core)
        {
            Text  = "Hello World";
            Font  = new Font("Times New Roman", 10);
            brush = new My_SolidBrush(Color.Black);
            pen   = new My_Pen(Color.Empty);

            draw       = Draw;
            mouse_move = MouseMoveCreateNew;
            mouse_down = MouseDownCreateNew;
            mouse_up   = MouseUpCreateNew;
        }
예제 #4
0
        public My_Text(EntityDrawningCore core, string Text, Point pt)
            : base(core)
        {
            this.core    = core;
            this.Text    = Text;
            Font         = new Font("Times New Roman", 10);
            brush        = new My_SolidBrush(Color.Black);
            center_point = pt;
            pen          = new My_Pen(Color.Empty);

            draw       = Draw;
            mouse_move = MouseMove;
            mouse_down = MouseDown;
            mouse_up   = MouseUp;
        }