Ejemplo n.º 1
0
        /// <summary>
        /// Gets the point on the <see cref="ImageGraphic"/> closest to the specified point.
        /// </summary>
        /// <param name="point">A point in either source or destination coordinates.</param>
        /// <returns>The point on the graphic closest to the given <paramref name="point"/>.</returns>
        /// <remarks>
        /// <para>
        /// Depending on the value of <see cref="Graphic.CoordinateSystem"/>,
        /// the computation will be carried out in either source
        /// or destination coordinates.</para>
        /// </remarks>
        public override PointF GetClosestPoint(PointF point)
        {
            RectangleF rect = this.BoundingBox;

            if (rect.Contains(point))
            {
                return(point);
            }
            return(RectanglePrimitive.GetClosestPoint(point, rect));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the point on the <see cref="Graphic"/> closest to the specified point.
 /// </summary>
 /// <param name="point">A point in either source or destination coordinates.</param>
 /// <returns>The point on the graphic closest to the given <paramref name="point"/>.</returns>
 /// <remarks>
 /// <para>
 /// Depending on the value of <see cref="Graphic.CoordinateSystem"/>,
 /// the computation will be carried out in either source
 /// or destination coordinates.</para>
 /// </remarks>
 public override PointF GetClosestPoint(PointF point)
 {
     return(RectanglePrimitive.GetClosestPoint(point, this.Rectangle));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets the point on the <see cref="Graphic"/> closest to the specified point.
 /// </summary>
 /// <param name="point">A point in either source or destination coordinates.</param>
 /// <returns>The point on the graphic closest to the given <paramref name="point"/>.</returns>
 /// <remarks>
 /// <para>
 /// Depending on the value of <see cref="Graphic.CoordinateSystem"/>,
 /// the computation will be carried out in either source
 /// or destination coordinates.</para>
 /// </remarks>
 public virtual PointF GetClosestPoint(PointF point)
 {
     return(RectanglePrimitive.GetClosestPoint(point, this.BoundingBox));
 }