本文整理汇总了C#中Eto.Drawing.Pen类的典型用法代码示例。如果您正苦于以下问题:C# Pen类的具体用法?C# Pen怎么用?C# Pen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Pen类属于Eto.Drawing命名空间,在下文中一共展示了Pen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawingRectangleAdorner
public DrawingRectangleAdorner(PictureBox pictureBox)
{
pictureBox.MouseDown += PictureBox_MouseDown;
pictureBox.MouseMove += PictureBox_MouseMove;
pictureBox.MouseUp += PictureBox_MouseUp;
pictureBox.Paint += PictureBox_Paint;
control = pictureBox;
rect = RectangleF.Empty;
Pen = new Pen(Colors.Green, 5);
}
示例2: GetPen
static Pen GetPen (Generator generator, Color color, float thickness = 1f, DashStyle dashStyle = null)
{
var cache = generator.Cache<PenKey, Pen> (cacheKey);
Pen pen;
lock (cache) {
var key = new PenKey (color.ToArgb (), thickness, dashStyle);
if (!cache.TryGetValue (key, out pen)) {
pen = new Pen (color, thickness, generator);
if (dashStyle != null) pen.DashStyle = dashStyle;
cache.Add (key, pen);
}
}
return pen;
}
示例3: DrawingPenAdorner
public DrawingPenAdorner(PictureBox pictureBox)
{
pictureBox.MouseDown += PictureBox_MouseDown;
pictureBox.MouseMove += PictureBox_MouseMove;
pictureBox.MouseUp += PictureBox_MouseUp;
pictureBox.Paint += PictureBox_Paint;
control = pictureBox;
Paths = new List<Path>();
Pen = new Pen(Colors.Green, 10);
Pen.LineCap = PenLineCap.Round;
Pen.LineJoin = PenLineJoin.Round;
}
示例4: SetMiterLimit
public void SetMiterLimit(Pen widget, float miterLimit)
{
throw new NotImplementedException();
}
示例5: SetLineCap
public void SetLineCap(Pen widget, PenLineCap lineCap)
{
throw new NotImplementedException();
}
示例6: SetLineJoin
public void SetLineJoin(Pen widget, PenLineJoin lineJoin)
{
throw new NotImplementedException();
}
示例7: SetThickness
public void SetThickness(Pen widget, float thickness)
{
throw new NotImplementedException();
}
示例8: SetColor
public void SetColor(Pen widget, Color color)
{
throw new NotImplementedException();
}
示例9: ToPen
/// <summary>
///
/// </summary>
/// <param name="style"></param>
/// <param name="scale"></param>
/// <returns></returns>
private Pen ToPen(BaseStyle style, Func<double, float> scale)
{
var pen = new Pen(
ToColor(style.Stroke),
scale(style.Thickness / _state.Zoom));
switch (style.LineCap)
{
case Test2d.LineCap.Flat:
pen.LineCap = PenLineCap.Butt;
break;
case Test2d.LineCap.Square:
pen.LineCap = PenLineCap.Square;
break;
case Test2d.LineCap.Round:
pen.LineCap = PenLineCap.Round;
break;
}
if (style.Dashes != null)
{
pen.DashStyle = new DashStyle(
(float)style.DashOffset,
style.Dashes.Select(x => (float)x).ToArray());
}
return pen;
}
示例10: GetLineJoin
public PenLineJoin GetLineJoin(Pen widget)
{
return widget.ToAndroid().StrokeJoin.ToEto();
}
示例11: SetThickness
public void SetThickness(Pen widget, float thickness)
{
widget.ToAndroid().StrokeWidth = thickness;
}
示例12: GetThickness
public float GetThickness(Pen widget)
{
return widget.ToAndroid().StrokeWidth;
}
示例13: SetColor
public void SetColor(Pen widget, Color color)
{
widget.ToAndroid().Color = color.ToAndroid();
}
示例14: GetColor
public Color GetColor(Pen widget)
{
return widget.ToAndroid().Color.ToEto();
}
示例15: Draw
void Draw(Graphics g, Action<Pen> action)
{
var path = new GraphicsPath();
path.AddLines(new PointF(0, 0), new PointF(100, 40), new PointF(0, 30), new PointF(50, 70));
for (int i = 0; i < 4; i++)
{
float thickness = 1f + i * PenThickness;
var pen = new Pen(Colors.Black, thickness);
pen.LineCap = this.LineCap;
pen.LineJoin = this.LineJoin;
pen.DashStyle = this.DashStyle;
if (action != null)
action(pen);
var y = i * 20;
g.DrawLine(pen, 10, y, 110, y);
y = 80 + i * 50;
g.DrawRectangle(pen, 10, y, 100, 30);
y = i * 70;
g.DrawArc(pen, 140, y, 100, 80, 160, 160);
y = i * 70;
g.DrawEllipse(pen, 260, y, 100, 50);
g.SaveTransform();
y = i * 70;
g.TranslateTransform(400, y);
g.DrawPath(pen, path);
g.RestoreTransform();
}
}