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 。
Public constructors |
|
|---|---|
ArcShape(float startAngle, float sweepAngle) ArcShape构造函数。 |
|
公共方法(Public methods) |
|
|---|---|
void |
draw(Canvas canvas, Paint paint) 使用提供的Paint将此形状绘制到提供的Canvas中。 |
void |
getOutline(Outline outline) 计算形状的轮廓并将其返回到提供的大纲参数中。 |
继承方法(Inherited methods) |
|
|---|---|
android.graphics.drawable.shapes.RectShape
|
|
android.graphics.drawable.shapes.Shape
|
|
java.lang.Object
|
|
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. |
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 |
void getOutline (Outline outline)
计算形状的轮廓并将其返回到提供的大纲参数中。 默认实现不做任何操作, outline不会更改。
| 参数(Parameters) | |
|---|---|
outline |
Outline: The Outline to be populated with the result. Should not be null. |