locked
Fastest 2d polygon draw method? RRS feed

  • Question

  • User399274 posted

    Dear Xamarin forum users,

    Please would you suggest the fastest way to draw an immense amount of 2d polygons. I've tried SKPath but it involves repeated method calls per point! Is there a faster skiasharp facility for batch drawing loads of polygons?

    Many thanks in advance.

    Wednesday, February 10, 2021 9:58 PM

Answers

  • User379860 posted

    Please add Forms.SetFlags("Shapes_Experimental"); in the onCreate() method of MainActivity.cs like following screenshot.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, February 12, 2021 1:01 AM

All replies

  • User379860 posted

    You can use Xamarin.Forms Shapes: Polygon control to draw 2d polygons directly(but you need to know all of Points) like following link.

    https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/shapes/polygon

    And you do not need to repeated method calls, just use this control your xaml code.


    Xamarin forums are migrating to a new home on Microsoft Q&A! We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A! For more information, please refer to this sticky post.

    Thursday, February 11, 2021 1:22 AM
  • User399274 posted

    Intellisense shows Xamarin.Forms.Shapes.Polygon to be not yet added!?! The dependencies that I have are: Skiasharp.Svg (1.60.0) Skiasharp.Views.Forms (2.80.2) Xamarin.Essentials (1.6.1) Xamarin.Forms (5.0.0.1931)

    I don't think that I'm missing anything!?!

    Thursday, February 11, 2021 2:11 PM
  • User379860 posted

    Please add Forms.SetFlags("Shapes_Experimental"); in the onCreate() method of MainActivity.cs like following screenshot.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, February 12, 2021 1:01 AM
  • User399274 posted

    Thanks @LeonLu for your solution.

    Friday, February 12, 2021 5:45 PM