public class Region extends GdiObject
Modifier and Type | Class and Description |
---|---|
static class |
Region.CombineMode
CombineMode class represents EnumItemeration of combined operations.
|
GdiObject.ImageLoadParameters, GdiObject.ImageType, GdiObject.Type
Modifier and Type | Field and Description |
---|---|
static int |
COMPLEXREGION
The region consists of more than one rectangle.
|
static int |
NULLREGION
The region is empty.
|
static int |
RGN_ERROR |
static int |
SIMPLEREGION
The region consists of a single rectangle.
|
GDI_ERROR, HGDI_ERROR
INFINITE_TIMEOUT, INVALID_HANDLE_VALUE, STATUS_ABANDONED_WAIT_0, STATUS_TIMEOUT, STATUS_WAIT_0
Modifier and Type | Method and Description |
---|---|
static Region |
combineRgn(Region srcRgn1,
Region srcRgn2,
Region.CombineMode combineMode)
Creates a combined region from two specified regions.
|
static Region |
createElliptic(int left,
int top,
int right,
int bottom)
Factory method for creating elliptic regions.
|
static Region |
createElliptic(Rect rect)
Factory method for creating elliptic regions via bounding rectangle.
|
static Region |
createFromImage(java.awt.Image image)
Creates a region from the specified image.
|
static Region |
createFromImage(java.awt.Image image,
java.awt.Color transparent)
Creates a region from the specified image.
|
static Region |
createFromImage(java.awt.Image image,
java.awt.Color transparent,
java.awt.Color tolerance)
Creates a region from specified image.
|
static Region |
createPolygonRgn(Point[] points,
int nPoints,
PolyFillMode polyFillMode)
Creates a polygonal region.
|
static Region |
createPolyPolygonRgn(Point[] points,
int[] polyCounts,
int count,
PolyFillMode polyFillMode)
Creates a region consisting of a series of polygons.
|
static Region |
createRectRegion(int left,
int top,
int right,
int bottom)
Creates a rectangular region.
|
static Region |
createRectRegion(Rect rect)
Creates a rectangular region.
|
static Region |
createRoundRectRegion(int left,
int top,
int right,
int bottom,
int ellipseWidth,
int ellipseHight) |
boolean |
equalRegion(Region region)
Checks the two specified regions to determine whether they are identical.
|
int |
getRagionData(com.jniwrapper.PrimitiveArray rgnData,
int count)
Fills the specified buffer with data describing a region.
|
Rect |
getRegionBox()
Retrieves the bounding rectangle of the region.
|
boolean |
isPointInRegion(int x,
int y)
Determines whether the specified point is inside the specified region.
|
boolean |
isPointInRegion(Point point)
Determines whether the specified point is inside the specified region.
|
boolean |
isRectInRegion(Rect rect)
Determines whether any part of the specified rectangle is within the
boundaries of a region.
|
void |
offsetRegion(int xOffset,
int yOffset)
Moves a region by the specified offsets.
|
void |
setRectRegion(int left,
int top,
int right,
int bottom)
Converts a region into a rectangular region with the specified
coordinates.
|
deleteObject, getObject, getObjectType
clone, closeHandle, equals, waitFor, waitFor
asFunction, asFunction, asTypedPointer, castTo, castTo, getDebugInfo, getLength, getValue, hashCode, isNull, read, setValue, toString, write
public static final int RGN_ERROR
public static final int NULLREGION
public static final int SIMPLEREGION
public static final int COMPLEXREGION
public static Region createElliptic(int left, int top, int right, int bottom)
NULL
value in case
of error.public static Region createElliptic(Rect rect)
rect
- bounding rectangle for an elliptic region to be created.NULL
value in case
of error.public static Region createRoundRectRegion(int left, int top, int right, int bottom, int ellipseWidth, int ellipseHight)
public static Region combineRgn(Region srcRgn1, Region srcRgn2, Region.CombineMode combineMode)
srcRgn1
- the first region.srcRgn2
- the second region.combineMode
- combine method.public static Region createPolygonRgn(Point[] points, int nPoints, PolyFillMode polyFillMode)
points
- polyFillMode
- public static Region createPolyPolygonRgn(Point[] points, int[] polyCounts, int count, PolyFillMode polyFillMode)
points
- polyCounts
- count
- polyFillMode
- public static Region createRectRegion(int left, int top, int right, int bottom)
left
- top
- right
- bottom
- public static Region createRectRegion(Rect rect)
rect
- public boolean equalRegion(Region region)
region
- public int getRagionData(com.jniwrapper.PrimitiveArray rgnData, int count)
rgnData
- is a region data buffer.count
- is the size of the region data buffer.count
if the function succeeds and count specifies
an adequate number of bytes. If count
is too small or the
function fails, the return value is 0.public Rect getRegionBox()
public void offsetRegion(int xOffset, int yOffset)
xOffset
- yOffset
- public boolean isPointInRegion(int x, int y)
x
- y
- public boolean isPointInRegion(Point point)
point
- public boolean isRectInRegion(Rect rect)
rect
- public void setRectRegion(int left, int top, int right, int bottom)
left
- top
- right
- bottom
- public static Region createFromImage(java.awt.Image image, java.awt.Color transparent)
image
- is a source image.transparent
- is a transparent color of the image.public static Region createFromImage(java.awt.Image image, java.awt.Color transparent, java.awt.Color tolerance)
image
- is a source image.transparent
- is a transparent color of the image.tolerance
- is a color tolerance for the transparent color.public static Region createFromImage(java.awt.Image image)
image
- is a source image.