What is the class to draw circle on Android?

2

I know the%% class for rectangle and for circle

 private Rect retangulo = new Rect();

What is the class to draw circle on Android?

    
asked by anonymous 11.02.2017 / 01:14

2 answers

2

OvalShape , see documentation . Example:

OvalShape circle = new OvalShape(); 
circle.resize(50f * mDensity, 50f * mDensity);

Image:

Seesomeapplicationexamplesat Codota for Android .

    
11.02.2017 / 01:24
2

There is OvalShape that can be used as a circle too.

link

I would use this way:

protected void onDraw(Canvas canvas) {
  super.onDraw(canvas);
  OvalShape shape = new OvalShape();
  shape.setWidth(10);
  shape.setHeight(10);
  shape.draw(canvas, paint);
}

An oval that has the same width and height would be a circle.

    
11.02.2017 / 01:28