how to draw a path on canvas after a specific time delay?

I want to draw a path on canvas after a specific time delaym how can i achieve it? used thread but it freezes the UI.

private void OnPainSurface(object sender, SKPaintSurfaceEventArgs args)
 {
      canvas = args.Surface.Canvas;
      canvas.Clear();


      foreach (SKPath path in inProgressPaths.Values)
      {
           //Delay before drawing a path, ex: 5 seconds
           canvas.DrawPath(path, paint);
      }

}

Answers

  • VIVEKNEGIVIVEKNEGI USMember ✭✭✭

    canvas = args.Surface.Canvas;
    canvas.Clear();

      foreach (SKPath path in inProgressPaths.Values)
      {
           Task.Delay(5000);
           canvas.DrawPath(path, paint);
      }
    
Sign In or Register to comment.