コード例 #1
0
        /// <summary>
        /// Moves the annotation to a specific horizontal and vertical offset
        /// </summary>
        /// <param name="coordinates">The initial coordinates.</param>
        /// <param name="horizOffset">The horizontal offset.</param>
        /// <param name="vertOffset">The vertical offset.</param>
        protected override void MoveAnnotationTo(AnnotationCoordinates coordinates, double horizOffset,
                                                 double vertOffset)
        {
            var pointsCoords = _startDragAnnotationsMousePoints;

            for (int i = 0; i < pointsCoords.Length; i++)
            {
                var point = pointsCoords[i];

                point.X += horizOffset;
                point.Y += vertOffset;

                MoveBasePointTo(point, i, XAxis, YAxis);
            }

            OnAnnotationDragging(new AnnotationDragDeltaEventArgs(horizOffset, vertOffset));
        }
コード例 #2
0
        /// <summary>
        /// This method is used in internally by the <see cref="AnnotationResizeAdorner" />. Gets the adorner point positions
        /// </summary>
        /// <param name="coordinates">The previously calculated <see cref="AnnotationCoordinates"/> in screen pixels.</param>
        /// <returns>A list of points in screen pixels denoting the Adorner corners</returns>
        protected override Point[] GetBasePoints(AnnotationCoordinates coordinates)
        {
            var lineAnnotations = Annotations;
            var count           = lineAnnotations.Count();

            var points = new Point[count];

            for (int i = 0; i < count; i++)
            {
                var annotation = lineAnnotations[i];

                var xCoord = XAxis.GetCoordinate(annotation.X1);
                var yCoord = YAxis.GetCoordinate(annotation.Y1);

                points[i] = new Point(xCoord, yCoord);
            }

            return(points);
        }