Android APIs
public final class

Outline

extends Object
java.lang.Object
   ↳ android.graphics.Outline

Class Overview

Defines a simple shape, used for bounding graphical regions.

Can be used with a View, or computed by a Drawable, to drive the shape of shadows cast by a View, or to clip the contents of the View.

Summary

Public Constructors
Outline()
Constructs an empty Outline.
Outline(Outline src)
Constructs an Outline with a copy of the data in src.
Public Methods
boolean canClip()
Returns whether the outline can be used to clip a View.
boolean isEmpty()
Returns whether the Outline is empty.
void set(Outline src)
Replace the contents of this Outline with the contents of src.
void setConvexPath(Path convexPath)
Sets the Constructs an Outline from a convex path.
void setEmpty()
Sets the outline to be empty.
void setOval(Rect rect)
void setOval(int left, int top, int right, int bottom)
Sets the outline to the oval defined by input rect.
void setRect(Rect rect)
void setRect(int left, int top, int right, int bottom)
Sets the Outline to the rounded rect defined by the input rect, and corner radius.
void setRoundRect(Rect rect, float radius)
void setRoundRect(int left, int top, int right, int bottom, float radius)
Sets the Outline to the rounded rect defined by the input rect, and corner radius.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Outline ()

Constructs an empty Outline. Call one of the setter methods to make the outline valid for use with a View.

public Outline (Outline src)

Constructs an Outline with a copy of the data in src.

Public Methods

public boolean canClip ()

Returns whether the outline can be used to clip a View. Currently, only outlines that can be represented as a rectangle, circle, or round rect support clipping.

public boolean isEmpty ()

Returns whether the Outline is empty.

Outlines are empty when constructed, or if setEmpty() is called, until a setter method is called

See Also

public void set (Outline src)

Replace the contents of this Outline with the contents of src.

Parameters
src Source outline to copy from.

public void setConvexPath (Path convexPath)

Sets the Constructs an Outline from a convex path.

public void setEmpty ()

Sets the outline to be empty.

See Also

public void setOval (Rect rect)

public void setOval (int left, int top, int right, int bottom)

Sets the outline to the oval defined by input rect.

public void setRect (Rect rect)

public void setRect (int left, int top, int right, int bottom)

Sets the Outline to the rounded rect defined by the input rect, and corner radius.

public void setRoundRect (Rect rect, float radius)

public void setRoundRect (int left, int top, int right, int bottom, float radius)

Sets the Outline to the rounded rect defined by the input rect, and corner radius. Passing a zero radius is equivalent to calling setRect(int, int, int, int)