Пример #1
0
        //****************************************************************
        // Basic Shapes - Methods used for creating common paths.
        //****************************************************************

        /// <summary>
        /// Creates a new PPath with the shape of a line specified by the given coordinates.
        /// </summary>
        /// <param name="x1">The x-coordinate of the start-point of the line.</param>
        /// <param name="y1">The y-coordinate of the start-point of the line.</param>
        /// <param name="x2">The x-coordinate of the end-point of the line.</param>
        /// <param name="y2">The y-coordinate of the end-point of the line.</param>
        /// <returns>The new PPath node.</returns>
        public static PPath CreateLine(float x1, float y1, float x2, float y2)
        {
            PPath result = new PPath();

            result.AddLine(x1, y1, x2, y2);
            return(result);
        }
Пример #2
0
        /// <summary>
        /// Creates a new PPath with the shape of the polygon specified by the given dimension.
        /// </summary>
        /// <param name="points">The points in the desired polygon.</param>
        /// <returns>The new PPath node.</returns>
        public static PPath CreatePolygon(PointFx[] points)
        {
            PPath result = new PPath();

            result.AddPolygon(points);
            result.Brush = Color.White;
            return(result);
        }
Пример #3
0
        /// <summary>
        /// Creates a new PPath with the shape of the ellipse specified by the given dimensions.
        /// </summary>
        /// <param name="x">
        /// The x-coordinate of the top left corner of the bounding box of the ellipse.
        /// </param>
        /// <param name="y">
        /// The y-coordinate of the top left corner of the bounding box of the ellipse.
        /// </param>
        /// <param name="width">The width of the ellipse.</param>
        /// <param name="height">The height of the ellipse.</param>
        /// <returns>The new PPath node.</returns>
        public static PPath CreateEllipse(float x, float y, float width, float height)
        {
            PPath result = new PPath();

            result.AddEllipse(x, y, width, height);
            result.Brush = Color.White;
            return(result);
        }