Simple way to draw and interact with elements using the library SkiaSharp. Compatible with Xamarin Forms
Install the NuGet package SkiaSharp.Elements:
nuget install SkiaSharp.Element
- Rectangle
- Ellipse
- Image
- Text
- Polygon
- Line
- Group
var rectangle = new SkiaSharp.Elements.Rectangle(SKRect.Create(20, 20, 100, 100))
{
FillColor = SKColors.SpringGreen
};
canvas.Elements.Add(rectangle);
var rectangle = new SkiaSharp.Elements.Rectangle(SKRect.Create(120, 150, 100, 100))
{
FillColor = SKColors.SpringGreen
Transformation = SKMatrix.CreateRotationDegrees(45)
};
canvas.Elements.Add(rectangle);
new Animation((value) =>
{
rectangle.Transformation = SKMatrix.CreateRotationDegrees(360 * (float)value);
})
.Commit(this, "Anim", length: 2000, easing: Easing.SpringOut);