如何使用Skia Sharp添加rect或任何形状,并将填充颜色和笔触颜色应用于iOS中的该对象
答案 0 :(得分:6)
要绘制填充和描边,您必须执行两次绘制操作:
// the rectangle
var rect = SKRect.Create(10, 10, 100, 100);
// the brush (fill with blue)
var paint = new SKPaint {
Style = SKPaintStyle.Fill,
Color = SKColors.Blue
};
// draw fill
canvas.DrawRect(rect, paint);
// change the brush (stroke with red)
paint.Style = SKPaintStyle.Stroke;
paint.Color = SKColors.Red;
// draw stroke
canvas.DrawRect(rect, paint);