FelipeNicoletto / SkiaSharp.Elements

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

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

License:MIT License


Languages

Language:C# 100.0%