예제 #1
0
파일: PolygonMath.cs 프로젝트: hwebz/NTCWeb
        /// <summary>
        /// Aligns the specified polygon with its container (reference) polygon using the specified alignment. The container can be smaller than 'obj'.
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="container"></param>
        /// <param name="align"></param>
        /// <returns></returns>
        public static PointF[] AlignWith(PointF[] obj, PointF[] container, ContentAlignment align)
        {
            RectangleF origBounds = PolygonMath.GetBoundingBox(obj);
            RectangleF newBounds  = AlignWith(PolygonMath.GetBoundingBox(obj), PolygonMath.GetBoundingBox(container), align);

            return(PolygonMath.MovePoly(obj, new PointF(newBounds.X - origBounds.X, newBounds.Y - origBounds.Y)));
        }
예제 #2
0
파일: Utils.cs 프로젝트: timgaunt/resizer
 public static RotateFlipType combineFlipAndRotate(RotateFlipType flip, double angle)
 {
     return(PolygonMath.CombineFlipAndRotate(flip, angle));
 }
예제 #3
0
파일: PolygonMath.cs 프로젝트: hwebz/NTCWeb
        /// <summary>
        /// Moves the polygon so that the upper-left corner of its bounding box is located at 0,0.
        /// </summary>
        /// <param name="poly"></param>
        /// <returns></returns>
        public static PointF[] NormalizePoly(PointF[] poly)
        {
            RectangleF box = GetBoundingBox(poly);

            return(PolygonMath.MovePoly(poly, new PointF(-box.X, -box.Y)));
        }
예제 #4
0
파일: Utils.cs 프로젝트: timgaunt/resizer
 public static double normalizeTo90Intervals(double d)
 {
     return(PolygonMath.NormalizeTo90Intervals(d));
 }