/// <summary>
        /// Paints the ROI into the supplied window
        /// </summary>
        /// <param name="window">HALCON window</param>
        public override void Draw(HWindow window)
        {
            window.DispRectangle2(midR, midC, -phi, length1, length2);
            for (int i = 0; i < NumHandles; i++)
            {
                window.DispRectangle2(rows[i].D, cols[i].D, -phi, RoiDrawConfig.PaneWidth, RoiDrawConfig.PaneWidth);
            }

            window.DispArrow(midR, midC, midR + (Math.Sin(phi) * length1 * 1.2),
                             midC + (Math.Cos(phi) * length1 * 1.2), RoiDrawConfig.PaneWidth / 2);
        }
        /// <summary>
        /// Paints the active handle of the ROI object into the supplied window
        /// </summary>
        /// <param name="window">HALCON window</param>
        public override void DisplayActive(HWindow window)
        {
            window.DispRectangle2(rows[ActiveHandleIdx].D,
                                  cols[ActiveHandleIdx].D,
                                  -phi, RoiDrawConfig.PaneWidth, RoiDrawConfig.PaneWidth);

            if (ActiveHandleIdx == 5)
            {
                window.DispArrow(midR, midC,
                                 midR + (Math.Sin(phi) * length1 * 1.2),
                                 midC + (Math.Cos(phi) * length1 * 1.2),
                                 RoiDrawConfig.PaneWidth / 2);
            }
        }
 private void DisplayPointLineDistanceGraphics(HWindow windowHandle)
 {
     windowHandle.SetColor("yellow");
     windowHandle.SetLineWidth(3);
     if (PointLineGraphics == null)
     {
         return;
     }
     foreach (var line in PointLineGraphics)
     {
         windowHandle.DispArrow(line.YStart, line.XStart, line.YEnd, line.XEnd, ArrowSize);
     }
     windowHandle.SetLineWidth(1);
 }
Beispiel #4
0
        public override void draw(HWindow window, int imageWidth, int imageHeight)
        {
            window.SetColor(Color);
            window.SetDraw(DrawMode);
            window.SetLineWidth(LineWidth);
            window.SetLineStyle(LineStyle == "dot" ? new HTuple(2, 2) : new HTuple());

            double littleRecSize = getHandleWidth(imageWidth, imageHeight);

            window.DispRectangle2(midR, midC, -phi, length1, length2);//body

            window.SetDraw("fill");
            window.DispArrow(midR, midC, midR + (Math.Sin(phi) * length1 * 1.2), midC + (Math.Cos(phi) * length1 * 1.2), littleRecSize);

            if (Selected)
            {
                for (int i = 0; i < NumHandles; i++)
                {
                    window.DispRectangle2(rows[i].D, cols[i].D, -phi, littleRecSize, littleRecSize);
                    Application.DoEvents();
                }
            }
        }