Пример #1
0
        private void button_Select_Click(object sender, EventArgs e)
        {
            if (button_Select.Checked == true)
            {
                ButtonStates.SetState(toolStrip1, sender);

                select = true;
            }
            else
            {
                ButtonStates.RestoreState(toolStrip1);

                select = false;

                selectPt = new Point(-1, -1);
                pb.UnwireControl();


                for (int i = 0; i < pictureBox1.Controls.Count; i++)
                {
                    Control control = pictureBox1.Controls[i];
                    foreach (Annotation annotation in annotations)
                    {
                        //        annotation.Unwire();

                        if (control.Tag != null)
                        {
                            if (annotation.Tag == (int)control.Tag)
                            {
                                annotation.Update(control);
                            }
                        }
                    }
//                pictureBox1.Controls.Remove(control);
                }

                while (pictureBox1.Controls.Count > 0)
                {
                    pictureBox1.Controls.Remove(pictureBox1.Controls[0]);
                }
                foreach (Annotation annotation in annotations)
                {
                    annotation.Unwire();
                }


                //      pictureBox1.Focus();
                pictureBox1.Invalidate();
            }
        }
Пример #2
0
 private void button_Area_Click(object sender, EventArgs e)
 {
     if (button_Area.Checked == true)
     {
         areaMode = true;
         start    = new Point(-1, -1);
         end      = new Point(-1, -1);
         ButtonStates.SetState(toolStrip1, sender);
     }
     else
     {
         areaMode = false;
         ButtonStates.RestoreState(toolStrip1);//, sender);
     }
 }
Пример #3
0
        private void button_Calibrate_Click(object sender, EventArgs e)
        {
            if (button_Calibrate.Checked == true)
            {
                calibrationMode = true;
                ButtonStates.SetState(toolStrip1, sender);

                start = new Point(-1, -1);
                end   = new Point(-1, -1);
            }
            else
            {
                calibrationMode = false;
                ButtonStates.RestoreState(toolStrip1);//, sender);
            }
        }