Stroke Class

Defines a stroke for a shape.
Inheritance Hierarchy
SystemObject
  Aspose.Words.DrawingStroke

Namespace:  Aspose.Words.Drawing
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public class Stroke

The Stroke type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleColor
Defines the color of a stroke.
Public propertyCode exampleColor2
Defines a second color for a stroke.
Public propertyCode exampleDashStyle
Specifies the dot and dash pattern for a stroke.
Public propertyCode exampleEndArrowLength
Defines the arrowhead length for the end of a stroke.
Public propertyCode exampleEndArrowType
Defines the arrowhead for the end of a stroke.
Public propertyCode exampleEndArrowWidth
Defines the arrowhead width for the end of a stroke.
Public propertyCode exampleEndCap
Defines the cap style for the end of a stroke.
Public propertyCode exampleImageBytes
Defines the image for a stroke image or pattern fill.
Public propertyCode exampleJoinStyle
Defines the join style of a polyline.
Public propertyCode exampleLineStyle
Defines the line style of the stroke.
Public propertyCode exampleOn
Defines whether the path will be stroked.
Public propertyCode exampleOpacity
Defines the amount of transparency of a stroke. Valid range is from 0 to 1.
Public propertyCode exampleStartArrowLength
Defines the arrowhead length for the start of a stroke.
Public propertyCode exampleStartArrowType
Defines the arrowhead for the start of a stroke.
Public propertyCode exampleStartArrowWidth
Defines the arrowhead width for the start of a stroke.
Public propertyCode exampleWeight
Defines the brush thickness that strokes the path of a shape in points.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from Object.)
Remarks

Use the Stroke property to access stroke properties of a shape. You do not create instances of the Stroke class directly.

Examples
Shows how change stroke properties.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Create a new shape of type Rectangle
Shape rectangle = new Shape(doc, ShapeType.Rectangle);

// Change stroke properties
Stroke stroke = rectangle.Stroke;
stroke.On = true;
stroke.Weight = 5;
stroke.Color = Color.Red;
stroke.DashStyle = DashStyle.ShortDashDotDot;
stroke.JoinStyle = JoinStyle.Miter;
stroke.EndCap = EndCap.Square;
stroke.LineStyle = ShapeLineStyle.Triple;

// Insert shape object
builder.InsertNode(rectangle);
See Also