android.graphics.drawable.shapes
Class PathShape
java.lang.Object
android.graphics.drawable.shapes.Shape
android.graphics.drawable.shapes.PathShape
public class PathShape
- extends Shape
Creates geometric paths, utilizing the Path class.
The path can be drawn to a Canvas with its own draw() method,
but more graphical control is available if you instead pass
the PathShape to a ShapeDrawable.
|
Constructor Summary |
PathShape(Path path,
float stdWidth,
float stdHeight)
PathShape constructor. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PathShape
public PathShape(Path path,
float stdWidth,
float stdHeight)
- PathShape constructor.
- Parameters:
path - a Path that defines the geometric paths for this shapestdWidth - the standard width for the shape. Any changes to the
width with resize() will result in a width scaled based
on the new width divided by this width.stdHeight - the standard height for the shape. Any changes to the
height with resize() will result in a height scaled based
on the new height divided by this height.
draw
public void draw(Canvas canvas,
Paint paint)
- Description copied from class:
Shape
- Draw this shape into the provided Canvas, with the provided Paint.
Before calling this, you must call
Shape.resize(float,float).
- Specified by:
draw in class Shape
- Parameters:
canvas - the Canvas within which this shape should be drawnpaint - the Paint object that defines this shape's characteristics
onResize
protected void onResize(float width,
float height)
- Description copied from class:
Shape
- Callback method called when
Shape.resize(float,float) is executed.
- Overrides:
onResize in class Shape
- Parameters:
width - the new width of the Shapeheight - the new height of the Shape
Please submit a feedback, bug or feature