Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw a circle with smooth edges

I'm working with canvas im my application and I need to draw a circle.
To do that, I'm using the drawCicle(cx, cy, radious, paint) method for the canvas class.
The problem is that the circle's edges appear pixellated. And its kinf of oval.

This is my code:

public void drawCircle(){       
    Paint paint = new Paint();
    paint.setColor(Color.rgb(52, 73, 94));
    canvas.drawCircle(200, 300, 33, paint);     
}

enter image description here

like image 376
Roland Avatar asked Feb 10 '14 19:02

Roland


People also ask

How do you make smooth circles in SketchUp?

You can adjust the radius and number of segments in a circle entity's Entity Info panel. Context-click the circle you want to edit. From the menu that appears, choose Entity Info. In the Entity Info panel shown here, simply type a new value for the radius or number of segments.


1 Answers

Use paint.setFlags(Paint.ANTI_ALIAS_FLAG)

This enables anti-aliasing => edges become smoother

like image 168
Sam Avatar answered Oct 13 '22 01:10

Sam