Example usage for Java android.graphics RectF fields, constructors, methods, implement or subclass
The text is from its open source code.
RectF(float left, float top, float right, float bottom) Create a new rectangle with the specified coordinates. | |
RectF() Create a new empty RectF. | |
RectF(RectF r) Create a new rectangle, initialized with the values in the specified rectangle (which is left unmodified). | |
RectF(Rect r) |
float | centerX() |
float | centerY() |
boolean | contains(float x, float y) Returns true if (x,y) is inside the rectangle. |
boolean | contains(RectF r) Returns true iff the specified rectangle r is inside or equal to this rectangle. |
boolean | equals(Object o) |
float | height() |
void | inset(float dx, float dy) Inset the rectangle by (dx,dy). |
boolean | intersect(RectF r) If the specified rectangle intersects this rectangle, return true and set this rectangle to that intersection, otherwise return false and do not change this rectangle. |
boolean | intersect(float left, float top, float right, float bottom) If the rectangle specified by left,top,right,bottom intersects this rectangle, return true and set this rectangle to that intersection, otherwise return false and do not change this rectangle. |
boolean | intersects(RectF a, RectF b) Returns true iff the two specified rectangles intersect. |
boolean | isEmpty() Returns true if the rectangle is empty (left >= right or top >= bottom) |
void | offset(float dx, float dy) Offset the rectangle by adding dx to its left and right coordinates, and adding dy to its top and bottom coordinates. |
void | offsetTo(float newLeft, float newTop) Offset the rectangle to a specific (left, top) position, keeping its width and height the same. |
void | round(Rect dst) Set the dst integer Rect by rounding this rectangle's coordinates to their nearest integer values. |
void | roundOut(Rect dst) Set the dst integer Rect by rounding "out" this rectangle, choosing the floor of top and left, and the ceiling of right and bottom. |
void | set(float left, float top, float right, float bottom) Set the rectangle's coordinates to the specified values. |
void | set(RectF src) Copy the coordinates from src into this rectangle. |
void | set(Rect src) Copy the coordinates from src into this rectangle. |
void | setEmpty() Set the rectangle to (0,0,0,0) |
void | sort() Swap top/bottom or left/right if there are flipped (i.e. |
String | toString() |
void | union(RectF r) Update this Rect to enclose itself and the specified rectangle. |
float | width() |