2016-08-14 132 views

回答

1

简短的回答:没有

的NGraphic的Pen类不公开像StrokeJoinsStrokeCaps项目。

您可以随时修改源代码,将这些类型的属性添加到Pen类中,并设置相应的平台相关项目。

即在Android执行力度,私营GetPenPaint方法设置了Android Paint对象,只需要设置Paint.StrokeCap在适当的时候:

`paint.StrokeCap = Paint.Cap.Round;` 

编号:https://github.com/praeclarum/NGraphics/blob/master/Platforms/NGraphics.Android/AndroidPlatform.cs#L193

Paint GetPenPaint (Pen pen) 
{ 
    var paint = new Paint (PaintFlags.AntiAlias); 
    paint.SetStyle (Paint.Style.Stroke); 
    paint.SetARGB (pen.Color.A, pen.Color.R, pen.Color.G, pen.Color.B); 
    paint.StrokeWidth = (float)pen.Width; 

    if (pen.DashPattern != null && pen.DashPattern.Any()) { 
     var dashPathEffect = new DashPathEffect(pen.DashPattern.ToArray(), 0); 
     paint.SetPathEffect(dashPathEffect); 
    } 

    return paint; 
} 
+0

感谢您的responsed – LittleFunny

相关问题