public int windowsmallregionwidth = 5;//4边小矩形的大小
        /// <summary>Paints the ROI into the supplied window</summary>
        /// <param name="window">HALCON window</param>
        public override void draw(HalconDotNet.HWindow window)
        {
            window.DispRectangle1(row1, col1, row2, col2);
            if (SizeEnable && ShowRect)
            {
                int hrow, hcol, hw, hh;
                window.GetPart(out hrow, out hcol, out hh, out hw);
                int wrow, wcol, ww, wh;
                window.GetWindowExtents(out wrow, out wcol, out ww, out wh);

                double smallregionwidth  = (hw - hcol) * windowsmallregionwidth / ww;
                double smallregionheight = (hh - hrow) * windowsmallregionwidth / wh;
                //焦点小矩形最小为5
                if (smallregionwidth < 5)
                {
                    smallregionwidth = 5;
                }
                if (smallregionheight < 5)
                {
                    smallregionheight = 5;
                }

                window.DispRectangle2(row1, col1, 0, smallregionheight, smallregionwidth);
                window.DispRectangle2(row1, col2, 0, smallregionheight, smallregionwidth);
                window.DispRectangle2(row2, col2, 0, smallregionheight, smallregionwidth);
                window.DispRectangle2(row2, col1, 0, smallregionheight, smallregionwidth);
                window.DispRectangle2(midR, midC, 0, smallregionheight, smallregionwidth);
            }
        }
        /// <summary>
        /// 显示ROI
        /// </summary>
        /// <param name="hwin"></param>
        public override void displayROI(HalconDotNet.HWindow hwin)
        {
            hwin.DispRectangle1(this._row_y1, this._col_x1, this._row_y2, this._col_x2);

            if (this._operationing == -1)
            {
                hwin.DispRectangle2(this._row_y1, this._col_x1, 0, 5, 5);
                hwin.DispRectangle2(this._row_y1, this._col_x2, 0, 5, 5);
                hwin.DispRectangle2(this._row_y2, this._col_x1, 0, 5, 5);
                hwin.DispRectangle2(this._row_y2, this._col_x2, 0, 5, 5);
                hwin.DispRectangle2(this._mid_row_y, this._mid_col_x, 0, 5, 5);
            }
            else
            {
                for (int i = 0; i < _operation_piont_number; i++)
                {
                    if (i == _operationing)
                    {
                        displayOperation(i, hwin);
                    }
                    else
                    {
                        no_chice_point(i, hwin);
                    }
                }
            }
        }
Exemple #3
0
 /// <summary>Paints the ROI into the supplied window</summary>
 /// <param name="window">HALCON window</param>
 public override void draw(HalconDotNet.HWindow window)          //显示可以激活的句柄
 {
     window.DispRectangle1(row1, col1, row2, col2);
     window.DispRectangle2(row1, col1, 0, 5, 5);
     window.DispRectangle2(row1, col2, 0, 5, 5);
     window.DispRectangle2(row2, col2, 0, 5, 5);
     window.DispRectangle2(row2, col1, 0, 5, 5);
     window.DispRectangle2(midR, midC, 0, 5, 5);
 }
Exemple #4
0
        /// <summary>Paints the ROI into the supplied window</summary>
        /// <param name="window">HALCON window</param>
        public override void draw(HalconDotNet.HWindow window)
        {
            window.DispRectangle1(row1, col1, row2, col2);

            window.DispRectangle2(row1, col1, 0, 5, 5);
            window.DispRectangle2(row1, col2, 0, 5, 5);
            window.DispRectangle2(row2, col2, 0, 5, 5);
            window.DispRectangle2(row2, col1, 0, 5, 5);
            window.DispCross(midR, midC, 10, 0);
            //window.DispRectangle2(midR, midC, 0, 5, 5);
        }
Exemple #5
0
 /// <summary>Paints the ROI into the supplied window</summary>
 /// <param name="window">HALCON window</param>
 public override void draw(HalconDotNet.HWindow window)
 {
     window.DispRectangle1(row1, col1, row2, col2);
     if (SizeEnable && ShowRect)
     {
         window.DispRectangle2(row1, col1, 0, smallregionwidth, smallregionwidth);
         window.DispRectangle2(row1, col2, 0, smallregionwidth, smallregionwidth);
         window.DispRectangle2(row2, col2, 0, smallregionwidth, smallregionwidth);
         window.DispRectangle2(row2, col1, 0, smallregionwidth, smallregionwidth);
         window.DispRectangle2(midR, midC, 0, smallregionwidth, smallregionwidth);
     }
 }
Exemple #6
0
        /// <summary>Paints the ROI into the supplied window</summary>
        /// <param name="window">HALCON window</param>
        public override void Draw(HalconDotNet.HWindow window)
        {
            window.DispRectangle1(row1, col1, row2, col2);

            int width = GetHandleWidth();

            window.DispRectangle2(row1, col1, 0, width, width);
            window.DispRectangle2(row1, col2, 0, width, width);
            window.DispRectangle2(row2, col2, 0, width, width);
            window.DispRectangle2(row2, col1, 0, width, width);
            window.DispRectangle2(midR, midC, 0, width, width);
        }
Exemple #7
0
        /// <summary>Paints the ROI into the supplied window</summary>
        /// <param name="window">HALCON window</param>
        public override void draw(HalconDotNet.HWindow window)
        {
            var width  = 15;           //original 5;
            var height = 15;           //original 10;

            window.DispRectangle1(row1, col1, row2, col2);

            window.DispRectangle2(row1, col1, 0, width, height);
            window.DispRectangle2(row1, col2, 0, width, height);
            window.DispRectangle2(row2, col2, 0, width, height);
            window.DispRectangle2(row2, col1, 0, width, height);
            window.DispRectangle2(midR, midC, 0, width, height);
        }
Exemple #8
0
        /// <summary>Paints the ROI into the supplied window</summary>
        /// <param name="window">HALCON window</param>
        public override void draw(HalconDotNet.HWindow window, int imageWidth, int imageHeight)
        {
            double littleRecSize = 0;

            if (imageHeight < 300)
            {
                littleRecSize = 1;
            }
            else if (imageHeight < 600)
            {
                littleRecSize = 2;
            }
            else if (imageHeight < 900)
            {
                littleRecSize = 3;
            }
            else if (imageHeight < 1200)
            {
                littleRecSize = 4;
            }
            else if (imageHeight < 1500)
            {
                littleRecSize = 5;
            }
            else if (imageHeight < 1800)
            {
                littleRecSize = 6;
            }
            else if (imageHeight < 2100)
            {
                littleRecSize = 7;
            }
            else if (imageHeight < 2400)
            {
                littleRecSize = 8;
            }
            else if (imageHeight < 2700)
            {
                littleRecSize = 9;
            }
            else if (imageHeight < 3000)
            {
                littleRecSize = 10;
            }
            else if (imageHeight < 3300)
            {
                littleRecSize = 11;
            }
            else if (imageHeight < 3600)
            {
                littleRecSize = 12;
            }
            else if (imageHeight < 3900)
            {
                littleRecSize = 13;
            }
            else if (imageHeight < 4200)
            {
                littleRecSize = 14;
            }
            else if (imageHeight < 4500)
            {
                littleRecSize = 15;
            }
            else if (imageHeight < 4800)
            {
                littleRecSize = 16;
            }
            else if (imageHeight < 5100)
            {
                littleRecSize = 17;
            }
            else
            {
                littleRecSize = 18;
            }

            window.DispRectangle1(row1, col1, row2, col2);

            window.DispRectangle2(row1, col1, 0, littleRecSize, littleRecSize);
            window.DispRectangle2(row1, col2, 0, littleRecSize, littleRecSize);
            window.DispRectangle2(row2, col2, 0, littleRecSize, littleRecSize);
            window.DispRectangle2(row2, col1, 0, littleRecSize, littleRecSize);
            window.DispRectangle2(midR, midC, 0, littleRecSize, littleRecSize);
            window.DispRectangle2((row1 + row2) / 2, col1, 0, littleRecSize, littleRecSize);
            window.DispRectangle2((row1 + row2) / 2, col2, 0, littleRecSize, littleRecSize);
            window.DispRectangle2(row1, (col1 + col2) / 2, 0, littleRecSize, littleRecSize);
            window.DispRectangle2(row2, (col1 + col2) / 2, 0, littleRecSize, littleRecSize);
        }