9

如何使用 Skia Sharp 添加矩形或任何形状并将填充颜色和描边颜色应用于 iOS 中的该对象

4

1 回答 1

17

要同时绘制填充和描边,您必须执行两个绘制操作:

// 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);
于 2017-02-17T15:11:16.453 回答