public final class Brush
This class encapsulates a Windows brush. Brushes are used for filling areas of a window or a graphics region. You can create a brush whose appearance is based on the constants defined in this class, or you can create a brush based on a bitmap.
Fields
Name | Description |
---|---|
BLACK | Standard black brush. |
DARKGRAY | Standard dark gray brush. |
GRAY | Standard gray brush. |
HALFTONE | Standard halftone brush. |
HOLLOW | Hollow brush. |
LIGHTGRAY | Light gray brush. |
NULL | Null brush. |
STYLE_BDIAGONAL | Standard brush style consisting of backward diagonal lines. |
STYLE_DIAGCROSS | Standard brush style consisting of diagonal crisscross lines. |
STYLE_FDIAGONAL | Standard brush style consisting of forward diagonal lines. |
STYLE_HORIZONTAL | Standard brush style consisting of horizontal lines. |
STYLE_VERTICAL | Standard brush style consisting of vertical lines. |
WHITE | White brush. |
Constructors
Name | Description |
---|---|
Brush(Color color) | Creates a new solid brush of the specified color. |
Brush(Color color, int style) | Creates a new brush of the style and color. |
Brush(Bitmap bmp) | Creates a brush based on the specified bitmap. |
Brush(int handle) | Creates a brush based on an existing Win32 handle. |
Methods
Name | Description |
---|---|
equals(Object obj) | Retrieves a boolean value that indicates whether the specified object is equivalent to this brush. |
finalize() throws Throwable | Cleans up the Win32 resources associated with this brush. |
getColor() | Retrieves the color of this brush. |
getHandle() | Retrieves the Win32 handle of the brush. |
getStyle() | Retrieves the style of the brush. |
hashCode() | Computes and returns the hash code for this Brush object. |
Creates a new solid brush of the specified color.
Creates a new brush of the style and color.
Creates a brush based on the specified bitmap.
Creates a brush based on an existing Win32 handle. The brush does not own the handle.
Returns true if the specified object is equalivalent to this brush; otherwise, returns false.
Retrieves a boolean value that indicates whether the specified object is equivalent to this brush.
Cleans up the Win32 resources associated with this brush.
Throwable thrown if resources associated with this brush cannot be freed.
Returns the brush color.
Retrieves the color of this brush.
Returns a Win32 handle value.
Retrieves the Win32 handle of the brush.
Returns one of the Brush.STYLE_ constants.
Retrieves the style of the brush.
Returns an integer hash code value.
Computes and returns the hash code for this Brush object.