1
如何使用Skia的夏普添加矩形或任意形状和iOS中如何使用Skia Sharp添加矩形并将填充颜色和笔触颜色应用于该对象?
颜色和笔触颜色同时适用于填充到该对象如何使用Skia的夏普添加矩形或任意形状和iOS中如何使用Skia Sharp添加矩形并将填充颜色和笔触颜色应用于该对象?
颜色和笔触颜色同时适用于填充到该对象要绘制两个填充和中风,你必须做两个喷漆操作:
// 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);
感谢@Matthew的帮助,你能帮我找到通过UIVIew和SkiaSharp绘图的区别,看起来两者都很相似。 – Devaraj
这样没有真正的区别。但SkiaSharp的优势在于,代码在大多数平台上都可以100%重用 - 服务器移动,Windows到Linux。 – Matthew