Most visited

Recently visited

Added in API level 1

ArcShape

public class ArcShape
extends RectShape

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


创建一个弧形。 圆弧形状从指定的角度开始,顺时针方向扫描,绘制出馅饼片。 电弧可以得出与自己的draw()方法的画布,但更多的图形控件可用,如果你不是通过ArcShape为ShapeDrawable

Summary

Public constructors

ArcShape(float startAngle, float sweepAngle)

ArcShape构造函数。

Public methods

void draw(Canvas canvas, Paint paint)

使用提供的Paint将此形状绘制到提供的Canvas中。

void getOutline(Outline outline)

计算形状的轮廓并将其返回到提供的大纲参数中。

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构造函数。

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)

使用提供的Paint将此形状绘制到提供的Canvas中。 在致电之前,您必须致电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)

计算形状的轮廓并将其返回到提供的大纲参数中。 默认实现不做任何操作, outline不会更改。

Parameters
outline Outline: The Outline to be populated with the result. Should not be null.

Hooray!