Back to DOM
PathClass
Definition
- Namespace
- DOM.Elements.Graphics
- Assembly
- DOM.dll
Represents a vector path composed of drawing commands (SVG-like geometry).
Remarks
A is a sequence of that together define an arbitrary vector shape. It extends, so it inherits fill, outline, transform, and wrapping properties, and is typically used for SVG-style custom shapes and icons. Path IPathCommands Graphic
Examples
csharp
1// 1. Create a simple move + line path
2var path = new Path
3{
4 PathCommands = new List<IPathCommands>
5 {
6 new PathCommands { commandsType = PathCommandsType.MoveTo, Offset = new BasePosition { X = 0, Y = 0 } },
7 new PathCommands { commandsType = PathCommandsType.LineTo, Offset = new BasePosition { X = 50, Y = 50 } }
8 }
9};
10
csharp
1// 2. Add a curve command
2path.PathCommands.Add(new PathCommands
3{
4 commandsType = PathCommandsType.CurveTo,
5 Offset = new BasePosition { X = 100, Y = 0 }
6});
7
csharp
1// 3. Close the path and add it to a document
2path.PathCommands.Add(new PathCommands { commandsType = PathCommandsType.ClosePath });
3doc.AddPath(path);
4
csharp
1// 4. Apply an outline to the path
2path.OutLine = new OutLine
3{
4 SolidFill = Color.DarkBlue,
5 Width = new DocumentUnit(1.5, Units.pt)
6};
7
Properties
PathCommandsIPathCommands
Gets or sets the list of drawing commands that compose the path.