本文整理汇总了C#中Eto.Drawing.Pen.Apply方法的典型用法代码示例。如果您正苦于以下问题:C# Pen.Apply方法的具体用法?C# Pen.Apply怎么用?C# Pen.Apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eto.Drawing.Pen
的用法示例。
在下文中一共展示了Pen.Apply方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawPath
public void DrawPath(Pen pen, IGraphicsPath path)
{
SetOffset(false);
StartDrawing();
pen.Apply(this);
Control.BeginPath();
Control.AddPath(path.ToCG());
Control.StrokePath();
EndDrawing();
}
示例2: DrawEllipse
public void DrawEllipse(Pen pen, float x, float y, float width, float height)
{
SetOffset(false);
StartDrawing();
var rect = new CGRect(x, y, width, height);
pen.Apply(this);
Control.StrokeEllipseInRect(rect);
EndDrawing();
}
示例3: DrawArc
public void DrawArc(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
{
SetOffset(false);
StartDrawing();
var rect = new CGRect(x, y, width, height);
pen.Apply(this);
var yscale = rect.Height / rect.Width;
var centerY = rect.GetMidY();
var centerX = rect.GetMidX();
Control.ConcatCTM(new CGAffineTransform(1.0f, 0, 0, yscale, 0, centerY - centerY * yscale));
Control.AddArc(centerX, centerY, rect.Width / 2, CGConversions.DegreesToRadians(startAngle), CGConversions.DegreesToRadians(startAngle + sweepAngle), sweepAngle < 0);
Control.StrokePath();
EndDrawing();
}
示例4: DrawLine
public void DrawLine(Pen pen, float startx, float starty, float endx, float endy)
{
SetOffset(false);
StartDrawing();
pen.Apply(this);
Control.StrokeLineSegments(new []
{
new CGPoint(startx, starty),
new CGPoint(endx, endy)
});
EndDrawing();
}