2
I know the Class Rect
for rectangle and circle
private Rect retangulo = new Rect();
What class to draw circle on Android?
2
I know the Class Rect
for rectangle and circle
private Rect retangulo = new Rect();
What class to draw circle on Android?
2
There is the OvalShape
, see at documentation. Example:
OvalShape circle = new OvalShape();
circle.resize(50f * mDensity, 50f * mDensity);
Imagery:
See some application examples on Codota for Android.
2
There is the OvalShape
that can be used as a circle as well.
https://developer.android.com/reference/android/graphics/drawable/shapes/OvalShape.html
I’d wear it like this:
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
OvalShape shape = new OvalShape();
shape.setWidth(10);
shape.setHeight(10);
shape.draw(canvas, paint);
}
an oval having the same width and height would be a circle.
Browser other questions tagged java android classes
You are not signed in. Login or sign up in order to post.