ATMLWorkBench.Forms.SignalConnector.getRegion C# (CSharp) 메소드

getRegion() 공개 메소드

public getRegion ( ) : Region
리턴 System.Drawing.Region
        public Region getRegion()
        {
            GraphicsPath gp = new GraphicsPath();
            gp.AddLine(origin, destination);
            Region region = new Region();
            int l = Math.Min(source.Bounds.Left, target.Bounds.Left);
            int t = Math.Min(source.Bounds.Top, target.Bounds.Top);
            int r = Math.Max(source.Bounds.Right, target.Bounds.Right);
            int b = Math.Max(source.Bounds.Bottom, target.Bounds.Bottom);

            Rectangle rect = new Rectangle(1, t, r-1, b-t);
            region.MakeEmpty();
            region.Union(rect);
            return region;
        }