11#if defined(__BORLANDC__)
28 Handle = ::CreateRectRgn(0, 0, 0, 0);
29 WARNX(OwlGDI, !
Handle, 0,
"Cannot create empty rect region");
53 Handle = ::CreateRectRgn(0, 0, 0, 0);
54 WARNX(OwlGDI, !
Handle, 0,
"Cannot create copy of region " <<
static_cast<void*
>(source.
GetHandle()));
56 ::CombineRgn(
static_cast<HRGN
>(
Handle), source,
nullptr, RGN_COPY);
69 Handle = ::CreateRectRgnIndirect(&rect);
70 WARNX(OwlGDI, !
Handle, 0,
"Cannot create rect region " << rect);
81 Handle = ::CreateEllipticRgnIndirect(&rect);
82 WARNX(OwlGDI, !
Handle, 0,
"Cannot create elliptic region " << rect);
91 Handle = ::CreateRoundRectRgn(rect.left, rect.top, rect.right, rect.bottom,
92 corner.cx, corner.cy);
93 WARNX(OwlGDI, !
Handle, 0,
"Cannot create roundrect region " << rect << corner);
102 Init(points, count, fillMode);
105void TRegion::Init(
const TPoint* points,
int count,
int fillMode)
107 Handle = ::CreatePolygonRgn(points, count, fillMode);
108 WARNX(OwlGDI, !
Handle, 0,
"Cannot create poly region with " << count <<
" points "
109 <<
"@" <<
static_cast<const void*
>(points));
121 Init(points, polyCounts, count, fillMode);
124void TRegion::Init(
const TPoint* points,
const int* polyCounts,
int count,
int fillMode)
126 Handle = ::CreatePolyPolygonRgn(points, polyCounts, count, fillMode);
127 WARNX(OwlGDI, !
Handle, 0,
"Cannot create polypoly region with " << count <<
" polygons "
128 <<
"@" <<
static_cast<const void*
>(points));
139 if (!::DeleteObject(
Handle))
#define WARNX(group, condition, level, message)
TGdiBase()
This default constructor sets Handle to 0 and ShouldDelete to true.
void CheckValid(uint resId=IDS_GDIFAILURE)
bool ShouldDelete
Should object delete GDI handle in dtor?
HANDLE Handle
GDI handle of this object.
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
TRegion, derived from TGdiObject, represents GDI abstract shapes or regions.
TRegion & operator|=(const TRegion &source)
Creates the union of this region and the given source region , and returns a reference to the result.
TEllipse
Defines the class-specific constant Ellipse, used to distinguish the ellipse constructor from the rec...
TRegion & operator&=(const TRegion &source)
Creates the intersection of this region with the given source region and returns a reference to the r...
TRegion & operator^=(const TRegion &source)
Creates the exclusive-or of this region and the given source region.
TRegion()
The default constructor creates an empty TRegion object.
HRGN GetHandle() const
Returns the handle of the region with type HREGION.
The tagSIZE struct is defined as.
static void Raise(uint resId=IDS_GDIFAILURE, HANDLE handle=0)
Throws the exception.
Definition of abstract GDI object class and derived classes.
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
Object Windows Library (OWLNext Core).
DIAG_DECLARE_GROUP(OwlThread)