[I have not looked at the specific drawing capabilities of Android, so I am talking in general terms here]
Presumably, you want to update the canvas having added a new point. To avoid invalidating (and clearing) the whole Canvas, I think most graphic systems allow you to invalidate a smaller rectangle on the drawing surface, so you might consder... 1) Save the bitmap of the rectangle where the new incoming point is going to be. 2) Issue the command to paint this bitmap onto the Canvas at the same place. 3) Draw the new point on the Canvas 4) Invalidate only the rectangular area - causing a refresh for the affected area only I see Android Canvas also has functions related to clipping, so perhaps setting the clip area around the new point would prevent clearing the whole Canvas. A cruder, and possibly easier approach is to save the whole Canvas, then redraw the canvas and the new point in that order, then invalidate the whole Canvas. HTH Ian Hunter On Jun 7, 8:37 am, RS <[email protected]> wrote: > Hi, > > I am trying to render a customized view which draws points on the > canvas whenever they arrive from a remote device. Whenever a new > value is obtained - it gets passed into my customized view which draws > it on the canvas - ( The canvas should still show my previous points). > Now whenever i call invalidate() in my onDraw() method it clears all > my previous points. The application is supposed to work with a stream > of data and as such there are large number of points which are > generated and as such we dont want to store the points in an array and > reproduce them on the canvas- rather just get the new point draw it on > the canvas (the previous points should stay). Does anyone know how to > go about keeping all previous canvas objects intact while performing > invalidate? > > Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

