PeachDrawing.Core

PeachDrawing.Core.Geometry

PathShapes Class

Adds common shapes to a GraphicsPath. Every method starts a new subpath, so shapes can be combined in one path, and closes it (except AddWave(this GraphicsPath, PaintPoint, PaintPoint, double, double), which is an open line); coordinates are in the same units as the path’s other methods.

public static class PathShapes

Inheritance System.Object → PathShapes

Methods  
AddCircle(this GraphicsPath, double, double, double) Adds a circle.
AddEllipse(this GraphicsPath, double, double, double, double) Adds an ellipse, drawn clockwise from its rightmost point as four quarter arcs.
AddPie(this GraphicsPath, double, double, double, double, double, double) Adds a pie slice: the center, a straight line out to the start of an elliptical arc, the arc, and a straight line back. A sweep of a full turn or more adds the whole ellipse instead.
AddPolygon(this GraphicsPath, IReadOnlyList<PaintPoint>) Adds a closed polygon through points. Fewer than two points add nothing.
AddRegularPolygon(this GraphicsPath, double, double, double, int, double) Adds a regular polygon whose first vertex points up (toward negative y) before rotation.
AddRoundedRectangle(this GraphicsPath, Rect, double) Adds a rectangle with the same circular radius on every corner.
AddRoundedRectangle(this GraphicsPath, Rect, double, double, double, double, double, double, double, double) Adds a rectangle whose four corners are each rounded by their own elliptical radii (the shape of a CSS border-radius). A corner with a zero radius on both axes stays square. The caller is responsible for radii that fit inside rect: they are used as given.
AddStar(this GraphicsPath, double, double, double, double, int, double) Adds a star whose first tip points up (toward negative y) before rotation.
AddWave(this GraphicsPath, PaintPoint, PaintPoint, double, double) Adds an open wavy line from start to end: a smooth wave built from cubic Béziers, one full period every wavelength along the line, swinging amplitude to either side of it. The wave starts on the line and swings to the left of the direction of travel first.