コード例 #1
0
        public PointF GetPoint(int index)
        {
            if (index < 0 || index > ControlPoints.Length)
            {
                throw ExceptionFactory.ArgumentOutOfRangeException("index");
            }

            return(GetActualPointFromControlPoint(ControlPoints[index]));
        }
コード例 #2
0
        public void RemovePoint(int index)
        {
            if (index < 0 || index > ControlPoints.Length)
            {
                throw ExceptionFactory.ArgumentOutOfRangeException("index");
            }

            var newArray = new PointF[ControlPoints.Length - 1];

            Array.Copy(ControlPoints, newArray, index);
            Array.Copy(ControlPoints, index + 1, newArray, index, ControlPoints.Length - index - 1);

            ControlPoints = newArray;
        }
コード例 #3
0
        public void SetPoint(PointF point, int index)
        {
            if (index < 0 || index >= ControlPoints.Length)
            {
                throw ExceptionFactory.ArgumentOutOfRangeException("index");
            }

            var actualPoints = new List <PointF>(GetPoints());

            actualPoints[index] = point;
            ControlPoints       = actualPoints.ToArray();
            Transform           = new Transform();
            OnChanged();
        }
コード例 #4
0
        public void InsertPoint(PointF point, int index)
        {
            if (index < 0 || index > ControlPoints.Length)
            {
                throw ExceptionFactory.ArgumentOutOfRangeException("index");
            }

            var actualPoints = new List <PointF>(GetPoints());

            actualPoints.Insert(index, point);

            // change original points to actual points and reset transform
            ControlPoints = actualPoints.ToArray();

            // OnChanged() will be fired in Transform property
            Transform = new Transform();
        }