A Region represents a simple or complex region on a device context or window. It uses
reference counting, so copying and assignment operations are fast.
Constructs a rectangular region with the given position and size.
Region.new(%(arg-type)Point% topLeft, Point bottomRight)Constructs a rectangular region from the top left point and the bottom right point.
Region.new(%(arg-type)Rect% rect)Constructs a rectangular region a Rect object.
Region.new(%(arg-type)Region% region)Constructs a region by copying another region.
Region.new(%(arg-type)Integer% n, Point points, Integer fillStyle = WINDING_RULE)Constructs a region corresponding to the polygon made of n points in the
provided array. fillStyle parameter may have values
WINDING_RULE
or ODDEVEN_RULE
.
NB: This constructor is only implemented for Win32 and GTK+ Widgets ports.
Region.new(%(arg-type)Bitmap% bmp) Region.new(%(arg-type)Bitmap% bmp, Colour transColour, Integer tolerance = 0)Constructs a region using the non-transparent pixels of a bitmap. See
Union for more details.
Destructor.
Clears the current region.
Returns a false or true value indicating whether the given point is
contained within the region.
Returns a false or true value indicating whether the given rectangle is
contained within the region.
All these methods test whether a given point or rectangle is contained
with the region. If the point or rectangle is completely outside the
rectangle, returns false
. If the point or rectangle is contained,
returns an integer (which will be true in Ruby).
If testing a Rectangle the return value will distinguish between a
wholly-contained rectangle (which will return value equal to
Wx::IN_REGION
) and a partly overlapping rectangle (which will have a
return value of Wx::PART_REGION
). Note that on Windows, this
distinction is not made; the return value will always be false
or
Wx::IN_REGION
)
Convert the region to a black and white bitmap with the white pixels
being inside the region.
Returns the outer bounds of the region.
Finds the intersection of this region and another, rectangular region, specified using position and size.
Boolean intersect(%(arg-type)Rect% rect)Finds the intersection of this region and another, rectangular region.
Boolean intersect(%(arg-type)Region% region)Finds the intersection of this region and another region.
true
if successful, false
otherwise.
Creates the intersection of the two regions, that is, the parts which are in both regions. The result
is stored in this region.
Returns true
if the region is empty, false
otherwise.
Subtracts a rectangular region from this region.
Boolean subtract(%(arg-type)Region% region)Subtracts a region from this region.
true
if successful, false
otherwise.
This operation combines the parts of ‘this’ region that are not part of the second region.
The result is stored in this region.
Moves the region by the specified offsets in horizontal and vertical
directions.
true
if successful, false
otherwise (the region is unchanged then).
Finds the union of this region and another, rectangular region, specified using position and size.
Boolean union(%(arg-type)Rect% rect)Finds the union of this region and another, rectangular region.
Boolean union(%(arg-type)Region% region)Finds the union of this region and another region.
Boolean union(%(arg-type)Bitmap% bmp)Finds the union of this region and the non-transparent pixels of a
bitmap. Bitmap’s mask is used to determine transparency. If the bitmap doesn’t
have a mask, solid rectangle of bitmap’s dimensions is used.
Finds the union of this region and the non-transparent pixels of a
bitmap. Colour to be treated as transparent is specified in the
transColour argument, along with an
optional colour tolerance value.
true
if successful, false
otherwise.
This operation creates a region that combines all of this region and the second region.
The result is stored in this region.
Finds the Xor of this region and another, rectangular region, specified using position and size.
Boolean xor(%(arg-type)Rect% rect)Finds the Xor of this region and another, rectangular region.
Boolean xor(%(arg-type)Region% region)Finds the Xor of this region and another region.
true
if successful, false
otherwise.
This operation creates a region that combines all of this region and the second region, except
for any overlapping areas. The result is stored in this region.
Copies region by reference counting.
[This page automatically generated from the Textile source at 2023-06-13 21:31:42 +0000]