本文整理汇总了C#中System.Drawing.Pen.ToStrokeStyle方法的典型用法代码示例。如果您正苦于以下问题:C# Pen.ToStrokeStyle方法的具体用法?C# Pen.ToStrokeStyle怎么用?C# Pen.ToStrokeStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Pen
的用法示例。
在下文中一共展示了Pen.ToStrokeStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawLines
public override void DrawLines(Pen pen, PointF[] points)
{
var brush = new SharpDX.Direct2D1.SolidColorBrush(_renderTarget, pen.Color.ToColor4());
var strokeStyle = pen.ToStrokeStyle(_renderTarget.Factory);
var strokeWidth = StrokeWidthFromPen(pen);
for (int i = 1; i < points.Length; i++)
{
_renderTarget.DrawLine(
new SharpDX.Vector2(points[i - 1].X, points[i - 1].Y),
new SharpDX.Vector2(points[i].X, points[i].Y),
brush, strokeWidth, strokeStyle);
}
}
示例2: DrawLine
public override void DrawLine(Pen pen, PointF pt1, PointF pt2)
{
var strokeWidth = StrokeWidthFromPen(pen);
var strokeStyle = pen.ToStrokeStyle(_renderTarget.Factory);
_renderTarget.DrawLine(new SharpDX.Vector2(pt1.X, pt1.Y), new SharpDX.Vector2(pt2.X, pt2.Y),
new SharpDX.Direct2D1.SolidColorBrush(_renderTarget, pen.Color.ToColor4()),
strokeWidth, strokeStyle);
}