0

I am drawing lines(free drawing) on the canvas by storing points in a queue and then painting the entire queue on the canvas. The performance deteriorates when the queue becomes large, as I am painting the entire set of points again from the starting of the queue.

Is there a way, I can draw only the new data on the canvas, without the need for redrawing the entire queue, just like update() method in Java Applets?

Thanks.

2 Answers 2

2

I did a similar thing, but drawing circles. Basically, the drawing happens on an offscreen bitmap, which is then drawn on the system canvas. See this paste

0
-2

Try using this to lock your canvas, write the data and then unlock and post the data.

Canvas c = holder.lockCanvas();
// Your code here
holder.unlockCanvasAndPost(c);
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.