Forum General


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

SkiaSharp DrawPoints with Polygon Mode Fill Paint

jcarasickjcarasick Member ✭✭

I am trying to draw a polygon with a Fill color using the DrawPoints method and SKPointMode.Polygon style. It seems to only draw the outline with no fill. Is there anyway to do this? Seems much more performant over the DrawPath method.

        var color = SKColors.Black;
        if (c != null)
            color = new SKColor((byte)c.R, (byte)c.G, (byte)c.B, (byte)c.A);
        var fillPaint = new SKPaint
            Style = SKPaintStyle.Fill,
            Color = color

    canvas.DrawPoints(SKPointMode.Polygon, points, fillPaint);



  • Antoine_BAntoine_B Member ✭✭


    Do you find a solution @jcarasick ?

  • jcarasickjcarasick Member ✭✭

    I didn't. I am still using the draw path method. one route i took which helped was creating one large path for many polygons (think multipart polygon) vs. many paths (one path per polygon).

    something like

                     var path = new SKPath();
                     foreach (var points in polygonlist)
                            for (var i = 1; i < points.Count; i++)
                  //render polygons
                      canvas.DrawPath(path, fillPaint);
                      canvas.DrawPath(path, outlinePaint);
  • Antoine_BAntoine_B Member ✭✭

    Okay, thank you for your answer.
    I still think that a solution must exist :smile:

  • RolandHuhnRolandHuhn USMember ✭✭

    Maybe a bit late, but here is a solution:

    You need to call Close() to fill the polygon.

Sign In or Register to comment.