views:

203

answers:

2

I'd like to include a simple draw feature on my app. A friend told me I can't use canvas because I need to control the frame buffer and not redraw the entire screen every for every frame. He suggested I find a openGL 2d engine. I've searched around and I've only found Rokon which doesn't have any documentation and the examples aren't quite what I need.

Any suggestions?

Thanks, Erik

A: 

I don't really understand what the problem is? If you simply wish to redraw some portion of the canvas you can use invalidate(rect).

http://developer.android.com/reference/android/view/View.html#invalidate()

LambergaR
invalidate(rect) is useful, Thanks.
Erik B
So, would it be a good idea to keep two float arrays and draw circles around each point that I touch? Is there any better way of doing this?
Erik B
It really depends on what you are trying to do. The most efficient way would probably be just to add new circles and reuse the canvas (actually the Bitmap file behind it)
LambergaR
A: 

Just create a custom veiw by extending the view class. in this custome view override the onDraw method. Android itself takes care of the pixels that have been changed and calling invalidate only refreshes the pixels that have been marked dirty

Funkyidol