Class GraphicsPath
Contents
[
Hide
]GraphicsPath class
Represents a series of connected lines and curves. This class cannot be inherited.
public sealed class GraphicsPath : ObjectWithBounds
Constructors
Name | Description |
---|---|
GraphicsPath() | Initializes a new instance of the GraphicsPath class. |
GraphicsPath(Figure[]) | Initializes a new instance of the GraphicsPath class. |
GraphicsPath(FillMode) | Initializes a new instance of the GraphicsPath class. |
GraphicsPath(Figure[], FillMode) | Initializes a new instance of the GraphicsPath class. |
Properties
Name | Description |
---|---|
override Bounds { get; } | Gets or sets the object’s bounds. |
Figures { get; } | Gets the path figures. |
FillMode { get; set; } | Gets or sets a FillMode enumeration that determines how the interiors of shapes in this GraphicsPath are filled. |
Methods
Name | Description |
---|---|
AddFigure(Figure) | Adds a new figure. |
AddFigures(Figure[]) | Adds new figures. |
AddPath(GraphicsPath) | Appends the specified GraphicsPath to this path. |
AddPath(GraphicsPath, bool) | Appends the specified GraphicsPath to this path. |
DeepClone() | Performs a deep clone of this graphics path. |
Flatten() | Converts each curve in this path into a sequence of connected line segments. |
Flatten(Matrix) | Applies the specified transform and then converts each curve in this GraphicsPath into a sequence of connected line segments. |
Flatten(Matrix, float) | Converts each curve in this GraphicsPath into a sequence of connected line segments. |
override GetBounds(Matrix) | Gets the object’s bounds. |
override GetBounds(Matrix, Pen) | Gets the object’s bounds. |
IsOutlineVisible(Point, Pen) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen . |
IsOutlineVisible(PointF, Pen) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen . |
IsOutlineVisible(float, float, Pen) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen . |
IsOutlineVisible(int, int, Pen) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen . |
IsOutlineVisible(Point, Pen, Graphics) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics . |
IsOutlineVisible(PointF, Pen, Graphics) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics . |
IsOutlineVisible(float, float, Pen, Graphics) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics . |
IsOutlineVisible(int, int, Pen, Graphics) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics . |
IsVisible(Point) | Indicates whether the specified point is contained within this GraphicsPath . |
IsVisible(PointF) | Indicates whether the specified point is contained within this GraphicsPath . |
IsVisible(float, float) | Indicates whether the specified point is contained within this GraphicsPath . |
IsVisible(int, int) | Indicates whether the specified point is contained within this GraphicsPath . |
IsVisible(Point, Graphics) | Indicates whether the specified point is contained within this GraphicsPath . |
IsVisible(PointF, Graphics) | Indicates whether the specified point is contained within this GraphicsPath . |
IsVisible(float, float, Graphics) | Indicates whether the specified point is contained within this GraphicsPath in the visible clip region of the specified Graphics . |
IsVisible(int, int, Graphics) | Indicates whether the specified point is contained within this GraphicsPath , using the specified Graphics . |
RemoveFigure(Figure) | Removes a figure. |
RemoveFigures(Figure[]) | Removes figures. |
Reset() | Empties the graphics path and sets the FillMode to Alternate. |
Reverse() | Reverses the order of figures, shapes, and points in each shape of this GraphicsPath . |
override Transform(Matrix) | Applies the specified transformation to the shape. |
Warp(PointF[], RectangleF) | Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath . |
Warp(PointF[], RectangleF, Matrix) | Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath . |
Warp(PointF[], RectangleF, Matrix, WarpMode) | Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath . |
Warp(PointF[], RectangleF, Matrix, WarpMode, float) | Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath . |
Widen(Pen) | Adds an additional outline to the path. |
Widen(Pen, Matrix) | Adds an additional outline to the GraphicsPath . |
Widen(Pen, Matrix, float) | Replaces this GraphicsPath with curves that enclose the area that is filled when this path is drawn by the specified pen. |
Examples
This examples make use of GraphicsPath and Graphics class to create and manipulate Figures on an Image surface. Example creates a new Image and draws paths with the help of GraphicsPath class. At the end DrawPath method exposed by Graphics class is called to render the paths on surface. Finally image is exported to Tiff file format.
[C#]
//Create an instance of Image
using (Aspose.PSD.Image image = new Aspose.PSD.FileFormats.Psd.PsdImage(500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.PSD.Graphics graphics = new Aspose.PSD.Graphics(image);
//Clear Graphics surface
graphics.Clear(Color.Wheat);
//Create an instance of GraphicsPath class
Aspose.PSD.GraphicsPath graphicspath = new Aspose.PSD.GraphicsPath();
//Create an instance of Figure class
Aspose.PSD.Figure figure = new Aspose.PSD.Figure();
//Add Shapes to Figure object
figure.AddShape(new Aspose.PSD.Shapes.RectangleShape(new RectangleF(10, 10, 300, 300)));
figure.AddShape(new Aspose.PSD.Shapes.EllipseShape(new RectangleF(50, 50, 300, 300)));
figure.AddShape(new Aspose.PSD.Shapes.PieShape(new Rectangle(new Point(250, 250), new Size(200, 200)), 0, 45));
//Add Figure object to GraphicsPath
graphicspath.AddFigure(figure);
//Draw path with Pen object of color Black
graphics.DrawPath(new Pen(Aspose.PSD.Color.Black, 2), graphicspath);
//Create an instance of TiffOptions and set its various properties
Aspose.PSD.ImageOptions.TiffOptions tiffOptions = new Aspose.PSD.ImageOptions.TiffOptions(Aspose.PSD.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// save all changes.
image.Save("C:\\temp\\output.tiff", tiffOptions);
}
See Also
- class ObjectWithBounds
- namespace Aspose.PSD
- assembly Aspose.PSD