Stroke
内容
[
隐藏
]Stroke class
定义形状的描边。
要了解更多信息,请访问使用形状文档文章。
public class Stroke
特性
姓名 | 描述 |
---|---|
BackColor { get; set; } | 获取或设置笔触的背景颜色。 |
BackThemeColor { get; set; } | 获取或设置代表描边背景颜色的 ThemeColor 对象。 |
BackTintAndShade { get; set; } | 获取或设置使描边背景颜色变亮或变暗的双精度值。 |
BaseForeColor { get; } | 获取笔触的基本前景色,不带任何修饰符。 |
Color { get; set; } | 定义笔触的颜色。 |
Color2 { get; set; } | 定义笔触的第二种颜色。 |
DashStyle { get; set; } | 指定笔触的点和虚线图案。 |
EndArrowLength { get; set; } | 定义笔划末端的箭头长度。 |
EndArrowType { get; set; } | 定义笔画末端的箭头。 |
EndArrowWidth { get; set; } | 定义笔画末端的箭头宽度。 |
EndCap { get; set; } | 定义笔画末端的端点样式。 |
Fill { get; } | 获取填充格式Stroke . |
ForeColor { get; set; } | 获取或设置笔触的前景色。 |
ForeThemeColor { get; set; } | 获取或设置代表描边前景色的 ThemeColor 对象。 |
ForeTintAndShade { get; set; } | 获取或设置使描边前景色变亮或变暗的双精度值。 |
ImageBytes { get; } | 定义描边图像或图案填充的图像。 |
JoinStyle { get; set; } | 定义折线的连接样式。 |
LineStyle { get; set; } | 定义笔触的线条样式。 |
On { get; set; } | 定义路径是否将被描边。 |
Opacity { get; set; } | 定义笔触的透明度。有效范围为 0 到 1。 |
StartArrowLength { get; set; } | 定义笔画起点的箭头长度。 |
StartArrowType { get; set; } | 定义笔画起点的箭头。 |
StartArrowWidth { get; set; } | 定义笔画起点的箭头宽度。 |
Transparency { get; set; } | 获取或设置介于 0.0(不透明)和 1.0(透明)之间的值,表示笔触的透明度。 |
Visible { get; set; } | 获取或设置指示笔画是否可见的标志。 |
Weight { get; set; } | 定义描边形状路径的画笔粗细(以点为单位)。 |
评论
使用Stroke
属性来访问形状的笔触属性。 您不创建Stroke
直接上课。
例子
显示如何改变笔触属性。
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.InsertShape(ShapeType.Rectangle, RelativeHorizontalPosition.LeftMargin, 100,
RelativeVerticalPosition.TopMargin, 100, 200, 200, WrapType.None);
// 基本形状,例如矩形,有两个可见部分。
// 1 - 填充,适用于形状轮廓内的区域:
shape.Fill.ForeColor = Color.White;
// 2 - 笔触,标记形状的轮廓:
// 修改此形状的笔触的各种属性。
Stroke stroke = shape.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;
stroke.Fill.TwoColorGradient(Color.Red, Color.Blue, GradientStyle.Vertical, GradientVariant.Variant1);
doc.Save(ArtifactsDir + "Shape.Stroke.docx");
也可以看看
- 命名空间 Aspose.Words.Drawing
- 部件 Aspose.Words