Skip to content

Most visited

Recently visited

navigation

ArcShape

public class ArcShape
extends RectShape

java.lang.Object
   ↳ android.graphics.drawable.shapes.Shape
     ↳ android.graphics.drawable.shapes.RectShape
       ↳ android.graphics.drawable.shapes.ArcShape


Creates an arc shape. The arc shape starts at a specified angle and sweeps clockwise, drawing slices of pie. The arc can be drawn to a Canvas with its own draw() method, but more graphical control is available if you instead pass the ArcShape to a ShapeDrawable.

Summary

Public constructors

ArcShape(float startAngle, float sweepAngle)

ArcShape constructor.

Public methods

void draw(Canvas canvas, Paint paint)

Draw this shape into the provided Canvas, with the provided Paint.

void getOutline(Outline outline)

Compute the Outline of the shape and return it in the supplied Outline parameter.

Inherited methods

From class android.graphics.drawable.shapes.RectShape
From class android.graphics.drawable.shapes.Shape
From class java.lang.Object

Public constructors

ArcShape

Added in API level 1
ArcShape (float startAngle, 
                float sweepAngle)

ArcShape constructor.

Parameters
startAngle float: the angle (in degrees) where the arc begins
sweepAngle float: the sweep angle (in degrees). Anything equal to or greater than 360 results in a complete circle/oval.

Public methods

draw

Added in API level 1
void draw (Canvas canvas, 
                Paint paint)

Draw this shape into the provided Canvas, with the provided Paint. Before calling this, you must call resize(float, float).

Parameters
canvas Canvas: the Canvas within which this shape should be drawn
paint Paint: the Paint object that defines this shape's characteristics

getOutline

Added in API level 21
void getOutline (Outline outline)

Compute the Outline of the shape and return it in the supplied Outline parameter. The default implementation does nothing and outline is not changed.

Parameters
outline Outline: The Outline to be populated with the result. Should not be null.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.