1

I want a circle on the canvas in android app.

It can be done either using a bitmap of circle or actually drawing a circle.

I have done both but the circle in later has rough edges.

Why is this happening. And how can i get the Circle as i expect ?

edit: Since android is running on phones varying in pixel density and screen size, is there a recommended method ? I want the circle to be smooth all the time.

1 Answers1

1

Try

paint.setAntiAlias(true)

or set a flag during creation

Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);

And tell us if it works

Gaskoin
  • 2,469
  • 13
  • 22
  • I will try this. Could you plz explain what this does exactly ? – user2917687 Mar 19 '14 at 06:16
  • This flag forces all the drawing methods that support antialiasing to use it. Antialiasing is basically a bunch of techniques to enhance the rendering quality. It will of course use more resources. More on antialiasing:http://en.wikipedia.org/wiki/Anti-aliasing – k3v1n4ud3 Mar 19 '14 at 06:35
  • so is it better to use bitmap instead of drawing circle ? – user2917687 Mar 19 '14 at 08:19
  • No, the best solution is to use antialiased shader (Paint with antialias) – Gaskoin Mar 19 '14 at 08:57