Skip to content

Simple way to draw and interact with elements using the library SkiaSharp. Compatible with Xamarin Forms

License

Notifications You must be signed in to change notification settings

FelipeNicoletto/SkiaSharp.Elements

Repository files navigation

SkiaSharp.Elements

Simple way to draw and interact with elements using the library SkiaSharp. Compatible with Xamarin Forms

Using Elements

Install the NuGet package SkiaSharp.Elements:

nuget install SkiaSharp.Element

Getting Started

Samples

Elements

  • Rectangle
  • Ellipse
  • Image
  • Text
  • Polygon
  • Line
  • Group

Drawing Rectangle

var rectangle = new SkiaSharp.Elements.Rectangle(SKRect.Create(20, 20, 100, 100))
{
    FillColor = SKColors.SpringGreen
};
canvas.Elements.Add(rectangle);

Transformation

var rectangle = new SkiaSharp.Elements.Rectangle(SKRect.Create(120, 150, 100, 100))
{
    FillColor = SKColors.SpringGreen
    Transformation = SKMatrix.CreateRotationDegrees(45)
};
canvas.Elements.Add(rectangle);

Animation

new Animation((value) =>
{
    rectangle.Transformation = SKMatrix.CreateRotationDegrees(360 * (float)value);
})
.Commit(this, "Anim", length: 2000, easing: Easing.SpringOut);

Samples

Get sample here

Releases

No releases published

Packages

No packages published

Languages