Stroke class
Stroke class
Defines a stroke for a shape. To learn more, visit the Working with Shapes documentation article.
Remarks
Use the Shape.stroke property to access stroke properties of a shape. You do not create instances of the Stroke class directly.
Properties
| Name | Description | 
|---|---|
| backColor | Gets or sets the background color of the stroke. | 
| backThemeColor | Gets or sets a ThemeColor object that represents the stroke background color. | 
| backTintAndShade | Gets or sets a double value that lightens or darkens the stroke background color. | 
| baseForeColor | Gets the base foreground color of the stroke without any modifiers. | 
| color | Defines the color of a stroke. | 
| color2 | Defines a second color for a stroke. | 
| dashStyle | Specifies the dot and dash pattern for a stroke. | 
| endArrowLength | Defines the arrowhead length for the end of a stroke. | 
| endArrowType | Defines the arrowhead for the end of a stroke. | 
| endArrowWidth | Defines the arrowhead width for the end of a stroke. | 
| endCap | Defines the cap style for the end of a stroke. | 
| fill | Gets fill formatting for the Stroke. | 
| foreColor | Gets or sets the foreground color of the stroke. | 
| foreThemeColor | Gets or sets a ThemeColor object that represents the stroke foreground color. | 
| foreTintAndShade | Gets or sets a double value that lightens or darkens the stroke foreground color. | 
| imageBytes | Defines the image for a stroke image or pattern fill. | 
| joinStyle | Defines the join style of a polyline. | 
| lineStyle | Defines the line style of the stroke. | 
| on | Defines whether the path will be stroked. | 
| opacity | Defines the amount of transparency of a stroke. Valid range is from 0 to 1. | 
| startArrowLength | Defines the arrowhead length for the start of a stroke. | 
| startArrowType | Defines the arrowhead for the start of a stroke. | 
| startArrowWidth | Defines the arrowhead width for the start of a stroke. | 
| transparency | Gets or sets a value between 0.0 (opaque) and 1.0 (clear) representing the degree of transparency of the stroke. | 
| visible | Gets or sets a flag indicating whether the stroke is visible. | 
| weight | Defines the brush thickness that strokes the path of a shape in points. | 
Examples
Shows how change stroke properties.
let doc = new aw.Document();
let builder = new aw.DocumentBuilder(doc);
let shape = builder.insertShape(aw.Drawing.ShapeType.Rectangle, aw.Drawing.RelativeHorizontalPosition.LeftMargin, 100,
  aw.Drawing.RelativeVerticalPosition.TopMargin, 100, 200, 200, aw.Drawing.WrapType.None);
// Basic shapes, such as the rectangle, have two visible parts.
// 1 -  The fill, which applies to the area within the outline of the shape:
shape.fill.foreColor = "#FFFFFF";
// 2 -  The stroke, which marks the outline of the shape:
// Modify various properties of this shape's stroke.
let stroke = shape.stroke;
stroke.on = true;
stroke.weight = 5;
stroke.color = "#FF0000";
stroke.dashStyle = aw.Drawing.DashStyle.ShortDashDotDot;
stroke.joinStyle = aw.Drawing.JoinStyle.Miter;
stroke.endCap = aw.Drawing.EndCap.Square;
stroke.lineStyle = aw.Drawing.ShapeLineStyle.Triple;
stroke.fill.twoColorGradient("#FF0000", "#0000FF", aw.Drawing.GradientStyle.Vertical, aw.Drawing.GradientVariant.Variant1);
doc.save(base.artifactsDir + "Shape.stroke.docx");
See Also
- module Aspose.Words.Drawing
- property Shape.stroke