Jimmy
Jimmy

Reputation: 1349

SkiaSharp - how to move objects on canvas

Is there a way to draw a line (or any shape) on a canvas, and then move that line?

I didn't see a way to do it, except maybe by constantly clearing and redrawing the entire canvas. Is that the only way?

Upvotes: 3

Views: 1816

Answers (1)

Matthew
Matthew

Reputation: 5222

That is the usual way - the canvas is tied to the update cycle of the view. SkiaSharp provides you with all the power, and does nothing.

If you have a complex drawing that takes a few milliseconds, and maybe could have areas cached, you can use temporary bitmaps. There is nothing stopping you from drawing to multiple bitmaps as things change, and then drawing all those bitmaps onto the screen when something needs updating.

Upvotes: 2

Related Questions