예제 #1
0
        private void imageBox_DoubleClick(object sender, EventArgs e)
        {
            var _e = (MouseEventArgs)e;
            if (!Application.OpenForms.OfType<FixedInImage>().Any())
            {
                foreach (ImagePoint p in listFixedInImage)
                {
                    if (p.IsHit(imageBox.PointToImage(_e.Location), imageBox) || p.IsHitLabel(imageBox.PointToImage(_e.Location), imageBox))
                    {
                        formFixedInImage = new FixedInImage(this, p);
                        formFixedInImage.Show();
                        break;
                    }
                }
            }
            if (!Application.OpenForms.OfType<FixedInObject>().Any())
            {
                foreach (ObjectPoint p in listFixedInObject)
                {
                    if (p.IsHit(imageBox.PointToImage(_e.Location), imageBox) || p.IsHitLabel(imageBox.PointToImage(_e.Location), imageBox))
                    {
                        formFixedInObject = new FixedInObject(this, p);
                        formFixedInObject.Show();
                        break;
                    }
                }
            }

            imageBox.Invalidate();
        }
예제 #2
0
 private void btn_PointFixedInImage_Click(object sender, EventArgs e)
 {
     if (!Application.OpenForms.OfType<FixedInImage>().Any() && !Application.OpenForms.OfType<FixedInObject>().Any())
         {
             ImagePoint tmp = new ImagePoint(new Pen(Color.Green, 2),cross);
             listFixedInImage.Add(tmp);
             formFixedInImage = new FixedInImage(this, tmp);
             formFixedInImage.Show();
             imageBox.Invalidate();
         }
 }