Awesome Open Source
Awesome Open Source

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

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Sample.SampleViews.SampleBasicPage"
             xmlns:elements="clr-namespace:SkiaSharp.Elements.Forms;assembly=SkiaSharp.Elements.Forms"
             Title="Detail">
             
    <elements:CanvasView x:Name="canvas" />
    
</ContentPage>

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.MakeRotationDegrees(45)
};
canvas.Elements.Add(rectangle);

Animation

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

Samples

Get sample here


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
C Sharp (276,818
Android (41,640
Ios (19,583
Windows (10,097
Macos (9,191
Dotnet (8,085
Animation (5,225
Cross Platform (3,355
Graphics (2,601
Xamarin (1,777
Element (410
Draw (391
Skiasharp (75
Skia (72
Rectangle (70
Related Projects