Reputation: 221
I'm trying to draw circles using SurfaceView and I was curious about whether or not you always use canvas when you draw something. Are there are other ways instead of using canvas, and what are the pros/cons? Also, how would you personally draw a circle with SurfaceView?
Upvotes: 1
Views: 331
Reputation: 52313
There are two basic options: use a Canvas, or OpenGL ES.
The easiest way to draw a circle is to use Canvas#drawCircle()
. Doing the equivalent with OpenGL ES is more involved, though there are various toolkits that can simplify things.
Depending on your needs, you may want to consider using a custom View instead. Canvas rendering on a SurfaceView is not hardware accelerated, but Canvas rendering on a custom View can be.
Upvotes: 3