Example #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();
        }
Example #2
0
 private void btn_PointFixedInObject_Click(object sender, EventArgs e)
 {
     if (!Application.OpenForms.OfType<FixedInObject>().Any() && !Application.OpenForms.OfType<FixedInImage>().Any())
         {
             if (tabControl1.SelectedTab.Equals(tabAirfoil) && !calibrateProfilePoint1.IsEmpty() && !calibrateProfilePoint2.IsEmpty()
                 || tabControl1.SelectedTab.Equals(tabAnalyze) && !images.getActual().point1.IsEmpty() && !images.getActual().point2.IsEmpty())
             {
                 ObjectPoint tmp = new ObjectPoint(new Pen(Color.Green,2));
                 tmp.setPointLocationByPoint(cross, calibrateProfilePoint1.Point, calibrateProfilePoint2.Point);
                 listFixedInObject.Add(tmp);
                 formFixedInObject = new FixedInObject(this, tmp);
                 formFixedInObject.Show();
                 imageBox.Invalidate();
             }
             else
             {
                 MessageBox.Show("There is no object to get fixed on!");
             }
         }
 }