Aspose::Words::Drawing::Stroke class
Contents
[
Hide
]Stroke class
Defines a stroke for a shape. To learn more, visit the Working with Shapes documentation article.
class Stroke : public Aspose::Words::Drawing::Core::IFillable
Methods
| Method | Description |
|---|---|
| get_BackColor() | Gets or sets the background color of the stroke. |
| get_BackThemeColor() | Gets or sets a ThemeColor object that represents the stroke background color. |
| get_BackTintAndShade() | Gets or sets a double value that lightens or darkens the stroke background color. |
| get_BaseForeColor() | Gets the base foreground color of the stroke without any modifiers. |
| get_Color() | Defines the color of a stroke. |
| get_Color2() | Defines a second color for a stroke. |
| get_DashStyle() | Specifies the dot and dash pattern for a stroke. |
| get_EndArrowLength() | Defines the arrowhead length for the end of a stroke. |
| get_EndArrowType() | Defines the arrowhead for the end of a stroke. |
| get_EndArrowWidth() | Defines the arrowhead width for the end of a stroke. |
| get_EndCap() | Defines the cap style for the end of a stroke. |
| get_Fill() | Gets fill formatting for the Stroke. |
| get_ForeColor() | Gets or sets the foreground color of the stroke. |
| get_ForeThemeColor() | Gets or sets a ThemeColor object that represents the stroke foreground color. |
| get_ForeTintAndShade() | Gets or sets a double value that lightens or darkens the stroke foreground color. |
| get_ImageBytes() | Defines the image for a stroke image or pattern fill. |
| get_JoinStyle() | Defines the join style of a polyline. |
| get_LineStyle() | Defines the line style of the stroke. |
| get_On() | Defines whether the path will be stroked. |
| get_Opacity() | Defines the amount of transparency of a stroke. Valid range is from 0 to 1. |
| get_StartArrowLength() | Defines the arrowhead length for the start of a stroke. |
| get_StartArrowType() | Defines the arrowhead for the start of a stroke. |
| get_StartArrowWidth() | Defines the arrowhead width for the start of a stroke. |
| get_Transparency() | Gets or sets a value between 0.0 (opaque) and 1.0 (clear) representing the degree of transparency of the stroke. |
| get_Visible() | Gets or sets a flag indicating whether the stroke is visible. |
| get_Weight() | Defines the brush thickness that strokes the path of a shape in points. |
| GetType() const override | |
| Is(const System::TypeInfo&) const override | |
| set_BackColor(System::Drawing::Color) | Setter for Aspose::Words::Drawing::Stroke::get_BackColor. |
| set_BackThemeColor(Aspose::Words::Themes::ThemeColor) | Setter for Aspose::Words::Drawing::Stroke::get_BackThemeColor. |
| set_BackTintAndShade(double) | Setter for Aspose::Words::Drawing::Stroke::get_BackTintAndShade. |
| set_Color(System::Drawing::Color) | Setter for Aspose::Words::Drawing::Stroke::get_Color. |
| set_Color2(System::Drawing::Color) | Setter for Aspose::Words::Drawing::Stroke::get_Color2. |
| set_DashStyle(Aspose::Words::Drawing::DashStyle) | Specifies the dot and dash pattern for a stroke. |
| set_EndArrowLength(Aspose::Words::Drawing::ArrowLength) | Defines the arrowhead length for the end of a stroke. |
| set_EndArrowType(Aspose::Words::Drawing::ArrowType) | Defines the arrowhead for the end of a stroke. |
| set_EndArrowWidth(Aspose::Words::Drawing::ArrowWidth) | Defines the arrowhead width for the end of a stroke. |
| set_EndCap(Aspose::Words::Drawing::EndCap) | Defines the cap style for the end of a stroke. |
| set_ForeColor(System::Drawing::Color) | Setter for Aspose::Words::Drawing::Stroke::get_ForeColor. |
| set_ForeThemeColor(Aspose::Words::Themes::ThemeColor) | Setter for Aspose::Words::Drawing::Stroke::get_ForeThemeColor. |
| set_ForeTintAndShade(double) | Setter for Aspose::Words::Drawing::Stroke::get_ForeTintAndShade. |
| set_JoinStyle(Aspose::Words::Drawing::JoinStyle) | Setter for Aspose::Words::Drawing::Stroke::get_JoinStyle. |
| set_LineStyle(Aspose::Words::Drawing::ShapeLineStyle) | Setter for Aspose::Words::Drawing::Stroke::get_LineStyle. |
| set_On(bool) | Setter for Aspose::Words::Drawing::Stroke::get_On. |
| set_Opacity(double) | Defines the amount of transparency of a stroke. Valid range is from 0 to 1. |
| set_StartArrowLength(Aspose::Words::Drawing::ArrowLength) | Defines the arrowhead length for the start of a stroke. |
| set_StartArrowType(Aspose::Words::Drawing::ArrowType) | Defines the arrowhead for the start of a stroke. |
| set_StartArrowWidth(Aspose::Words::Drawing::ArrowWidth) | Defines the arrowhead width for the start of a stroke. |
| set_Transparency(double) | Setter for Aspose::Words::Drawing::Stroke::get_Transparency. |
| set_Visible(bool) | Setter for Aspose::Words::Drawing::Stroke::get_Visible. |
| set_Weight(double) | Setter for Aspose::Words::Drawing::Stroke::get_Weight. |
| static Type() |
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.
auto doc = System::MakeObject<Aspose::Words::Document>();
auto builder = System::MakeObject<Aspose::Words::DocumentBuilder>(doc);
System::SharedPtr<Aspose::Words::Drawing::Shape> shape = builder->InsertShape(Aspose::Words::Drawing::ShapeType::Rectangle, Aspose::Words::Drawing::RelativeHorizontalPosition::LeftMargin, 100, Aspose::Words::Drawing::RelativeVerticalPosition::TopMargin, 100, 200, 200, Aspose::Words::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->get_Fill()->set_ForeColor(System::Drawing::Color::get_White());
// 2 - The stroke, which marks the outline of the shape:
// Modify various properties of this shape's stroke.
System::SharedPtr<Aspose::Words::Drawing::Stroke> stroke = shape->get_Stroke();
stroke->set_On(true);
stroke->set_Weight(5);
stroke->set_Color(System::Drawing::Color::get_Red());
stroke->set_DashStyle(Aspose::Words::Drawing::DashStyle::ShortDashDotDot);
stroke->set_JoinStyle(Aspose::Words::Drawing::JoinStyle::Miter);
stroke->set_EndCap(Aspose::Words::Drawing::EndCap::Square);
stroke->set_LineStyle(Aspose::Words::Drawing::ShapeLineStyle::Triple);
stroke->get_Fill()->TwoColorGradient(System::Drawing::Color::get_Red(), System::Drawing::Color::get_Blue(), Aspose::Words::Drawing::GradientStyle::Vertical, Aspose::Words::Drawing::GradientVariant::Variant1);
doc->Save(get_ArtifactsDir() + u"Shape.Stroke.docx");
See Also
- Namespace Aspose::Words::Drawing
- Library Aspose.Words for C++