How to add rect or any shape using Skia Sharp and apply both fill color and stroke color to that object in iOS
To draw both fill and stroke, you will have to do two paint operations:
// 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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With