diff --git a/samples/SkiaSharpSample.Shared/Samples/DrawVerticesSample.cs b/samples/SkiaSharpSample.Shared/Samples/DrawVerticesSample.cs new file mode 100644 index 000000000..a759b5c33 --- /dev/null +++ b/samples/SkiaSharpSample.Shared/Samples/DrawVerticesSample.cs @@ -0,0 +1,33 @@ +using System; + +using SkiaSharp; + +namespace SkiaSharpSample.Samples +{ + [Preserve(AllMembers = true)] + public class DrawVerticesSample : SampleBase + { + [Preserve] + public DrawVerticesSample() + { + } + + public override string Title => "Draw Vertices"; + + public override SampleCategories Category => SampleCategories.General; + + protected override void OnDrawSample(SKCanvas canvas, int width, int height) + { + canvas.Clear(SKColors.White); + var paint = new SKPaint + { + IsAntialias = true + }; + + var vertices = new[] { new SKPoint(110, 20), new SKPoint(160, 200), new SKPoint(10, 200) }; + var colors = new[] { SKColors.Red, SKColors.Green, SKColors.Blue }; + + canvas.DrawVertices(SKVertexMode.Triangles, vertices, colors, paint); + } + } +} diff --git a/samples/SkiaSharpSample.Shared/SkiaSharpSample.Shared.projitems b/samples/SkiaSharpSample.Shared/SkiaSharpSample.Shared.projitems index 3a8301d63..cc13acaf0 100644 --- a/samples/SkiaSharpSample.Shared/SkiaSharpSample.Shared.projitems +++ b/samples/SkiaSharpSample.Shared/SkiaSharpSample.Shared.projitems @@ -17,6 +17,7 @@ +