PurplePen.SelectingRectangleCourseObj.GetHandles C# (CSharp) Method

GetHandles() public method

public GetHandles ( ) : System.Drawing.PointF[]
return System.Drawing.PointF[]
        public override PointF[] GetHandles()
        {
            if (showHandles)
                return base.GetHandles();
            else
                return new PointF[0];
        }

Usage Example

コード例 #1
0
        // Hit test a location to see if it is over a handle. Return the handleLocation and handleCursor.
        bool HitTestHandle(PointF location, float pixelSize, out PointF handleLocation, out Cursor handleCursor)
        {
            PointF[] handles = selectingCourseObj.GetHandles();
            foreach (PointF handle in handles)
            {
                double distance = Geometry.Distance(location, handle);
                if (distance / pixelSize <= 3.0)
                {
                    // over a handle.
                    handleLocation = handle;
                    handleCursor   = selectingCourseObj.GetHandleCursor(handle);
                    return(true);
                }
            }

            // didn't find a handle.
            handleLocation = new PointF();
            handleCursor   = null;
            return(false);
        }