コード例 #1
0
ファイル: ClickDrawForm.cs プロジェクト: bodik16/ITEA
 public ClickDrawForm()
 {
     InitializeComponent();
     ClickGraphic = ClickDrawPanel.CreateGraphics();
     ClickPen     = new Pen(Color.Black, 3);
     ClickPen.SetLineCap(System.Drawing.Drawing2D.LineCap.Round, System.Drawing.Drawing2D.LineCap.Round, System.Drawing.Drawing2D.DashCap.Round);
 }
コード例 #2
0
ファイル: ClickDrawForm.cs プロジェクト: bodik16/ITEA
        private void ClickDrawPanel_MouseMove_1(object sender, MouseEventArgs e)
        {
            //ClickDrawPanel.Size = this.ClickDrawPanel.Size;
            //ClickDrawPanel.Width = this.ClickDrawPanel.Width;

            if (checkBox1.Checked)
            {
                if (IsMouseDown != true)
                {
                    old = e.Location;
                    Refresh();
                }
            }
            else
            {
                cursor         = ClickDrawPanel.PointToClient(Cursor.Position);
                Xposition.Text = Convert.ToString(cursor.X);
                Yposition.Text = Convert.ToString(cursor.Y);
                if (FreeDrawingCheck.Checked)
                {
                    //Drawcheck.Enabled = false;
                    //LoopCheck.Enabled = false;
                    if (e.Button == MouseButtons.Left)
                    {
                        ClickGraphic = ClickDrawPanel.CreateGraphics();
                        current      = e.Location;
                        ClickGraphic.DrawLine(ClickPen, old, current);
                        old = current;

                        comboBox1.Visible = true;
                        if (comboBox1.Text == "1")
                        {
                            ClickGraphic = ClickDrawPanel.CreateGraphics();
                            current      = e.Location;
                            ClickGraphic.DrawLine(ClickPen, old, current);
                            old = current;
                        }
                    }
                }
            }
        }