Region

Region class

Represents the interior of a graphic shape. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class Region : public System::Object

Methods

MethodDescription
SharedPtr<Region> Clone() constReturns a copy of the current object.
void Complement(const RectangleF&)Replaces the region represented by the current object with the portion of the region defined by the specified recangle that does not intersect with this region.
void Complement(const Rectangle&)Replaces the region represented by the current object with the portion of the region defined by the specified recangle that does not intersect with this region.
void Complement(const SharedPtr<Drawing2D::GraphicsPath>&)Replaces the region represented by the current object with the portion of the region defined by the specified path that does not intersect with this region.
void Complement(const SharedPtr<Region>&)Replaces the region represented by the current object with the portion of the specified region that does not intersect with this region.
void Dispose()Releases all operating system resources acquired by the current object.
bool Equals(const SharedPtr<Region>&, const SharedPtr<Graphics>&)Determines whether the specified region is identical to the region represented by the current object on the specified drawing surface.
virtual bool Equals(ptr)Compares objects using C# Object.Equals semantics.
static std::enable_if<IsSmartPtr<T1>::value&&IsSmartPtr<T2>::value, bool>::type Equals(T1 const&, T2 const&)Compares reference type objects in C# style.
static bool Equals(float const&, float const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
static bool Equals(double const&, double const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
void Exclude(const RectangleF&)Replaces the region represented by the current object with the result of exclusion of the region defined by the specified rectange from it.
void Exclude(const Rectangle&)Replaces the region represented by the current object with the result of exclusion of the region defined by the specified rectange from it.
void Exclude(const SharedPtr<Drawing2D::GraphicsPath>&)Replaces the region represented by the current object with the result of exclusion of the region defined by the specified path from it.
void Exclude(const SharedPtr<Region>&)Replaces the region represented by the current object with the result of exclusion of the specified region from it.
virtual bool FastCast(const Details::FastRttiBase&, void **) constFor internal purposes only.
RectangleF GetBounds(const SharedPtr<Graphics>&) constGets a RectangleF structure that represents a rectangle that bounds this Region on the drawing surface of a Graphics object.
Detail::SmartPtrCounter * GetCounter()Gets reference counter data structure associated with the object.
virtual int32_t GetHashCode() constAnalog of C# Object.GetHashCode() method. Enables hashing of custom objects.
SharedPtr<Drawing2D::RegionData> GetRegionData() constReturns a RegionData object containing data that defines the region represented by the current object.
ArrayPtr<RectangleF> GetRegionScans(const SharedPtr<Drawing2D::Matrix>&) constReturns an array of RectangleF structures that approximate this Region after the specified matrix transformation is applied.
virtual const TypeInfo& GetType() constGets actual type of object. Analog of C# System.Object.GetType() call.
void Intersect(const RectangleF&)Replaces the region represented by the current object with the result of intersection of this region and a region defined by the specified rectangle.
void Intersect(const Rectangle&)Replaces the region represented by the current object with the result of intersection of this region and a region defined by the specified rectangle.
void Intersect(const SharedPtr<Drawing2D::GraphicsPath>&)Replaces the region represented by the current object with the result of intersection of this region and a region defined by the specified path.
void Intersect(const SharedPtr<Region>&)Replaces the region represented by the current object with the result of intersection of this region and the specified region.
virtual bool Is(const TypeInfo&) constCheck if object represents an instance of type described by targetType. Analog of C# ‘is’ operator.
bool IsEmpty(const SharedPtr<Graphics>&) constDetermines wheter the region represented by the current object has empty interior on the specified drawing surface.
bool IsInfinite(const SharedPtr<Graphics>&) constDetermines wheter the region represented by the current object has infinite interior on the specified drawing surface.
bool IsVisible(const Point&) constDetermines if the specified point is contained within the region represented by the current object.
bool IsVisible(const PointF&) constDetermines if the specified point is contained within the region represented by the current object.
bool IsVisible(const Rectangle&)Determines if any portion the specified rectangle is contained within the region represented by the current object.
bool IsVisible(const RectangleF&)Determines if any portion the specified rectangle is contained within the region represented by the current object.
bool IsVisible(const Point&, const SharedPtr<Graphics>&) constDetermines if the specified point is contained within the region represented by the current object using the specified graphics.
bool IsVisible(const PointF&, const SharedPtr<Graphics>&) constDetermines if the specified point is contained within the region represented by the current object using the specified graphics.
bool IsVisible(const Rectangle&, const SharedPtr<Graphics>&)Determines if any portion the specified rectangle is contained within the region represented by the current object using the specified graphics.
bool IsVisible(const RectangleF&, const SharedPtr<Graphics>&)Determines if any portion the specified rectangle is contained within the region represented by the current object using the specified graphics.
bool IsVisible(float, float) constDetermines if the specified point is contained within the region represented by the current object.
bool IsVisible(float, float, const SharedPtr<Graphics>&) constDetermines if the specified point is contained within the region represented by the current object using the specified graphics.
void Lock()Implements C# lock() statement locking. Call directly or use LockContext sentry object.
void MakeEmpty()Initializes the current object to empty interior.
void MakeInfinite()Initializes this region object to an infinite interior.
virtual ptr MemberwiseClone() constAnalog of C# Object.MemberwiseClone() method. Enables cloning custom types.
Object()Creates object. Initializes all internal data structures.
Object(Object const&)Copy constructor. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
Object& operator=(Object const&)Assignment operator. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
static bool ReferenceEquals(ptr const&, ptr const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, T const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, std::nullptr_t)Reference-compares value type object with nullptr.
bool ReferenceEquals(String const&, std::nullptr_t)Specialization of Object::ReferenceEquals for case of string and nullptr.
bool ReferenceEquals(String const&, String const&)Specialization of Object::ReferenceEquals for case of strings.
Region()Constructs a new instance of Region class.
Region(const RectangleF&)Constructs a new instance of Region class that represents a region defined by the specified rectangle.
Region(const Rectangle&)Constructs a new instance of Region class that represents a region defined by the specified rectangle.
Region(const SharedPtr<Drawing2D::GraphicsPath>&)Constructs a new instance of Region class that represents a region defined by the specified path.
Region(const SkPath&)
Region(const SharedPtr<Drawing2D::RegionData>&)Constructs a new instance of Region class that represents a region defined by the specified RegionData object.
int RemovedSharedRefs(int)Decreases shared reference count by specified value.
virtual void SetTemplateWeakPtr(uint32_t)Set n’th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode.
int SharedCount() constGets current value of shared reference counter.
Object * SharedRefAdded()Increments shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
int SharedRefRemovedSafe()Decrements and returns shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
virtual String ToString() constAnalog of C# Object.ToString() method. Enables converting custom objects to string.
void Transform(const SharedPtr<Drawing2D::Matrix>&)Transforms this region by the specified matrix.
void Transform(const SkMatrix&)Transforms this region by the specified matrix.
void Translate(int, int)Moves the coordinates of the region by the specified amount.
void Translate(float, float)Moves the coordinates of the region by the specified amount.
static const TypeInfo& Type()Implements C# typeof(System.Object) construct.
void Union(const RectangleF&)Replaces the region represented by the current object with the result of union operation of this region and a region defined by the specified rectangle.
void Union(const Rectangle&)Replaces the region represented by the current object with the result of union of this region and a region defined by the specified rectangle.
void Union(const SharedPtr<Drawing2D::GraphicsPath>&)Replaces the region represented by the current object with the result of union of this region and a region defined by the specified path.
void Union(const SharedPtr<Region>&)Replaces the region represented by the current object with the result of union of this region and and the specified region.
void Unlock()Implements C# lock() statement unlocking. Call directly or use LockContext sentry object.
Detail::SmartPtrCounter * WeakRefAdded()Increments weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
void WeakRefRemoved()Decrements weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
void Xor(const RectangleF&)Replaces the region represented by the current object with the portions of this region and the region defined by the specified recangle that do not intersect.
void Xor(const Rectangle&)Replaces the region represented by the current object with the portions of this region and the region defined by the specified recangle that do not intersect.
void Xor(const SharedPtr<Drawing2D::GraphicsPath>&)Replaces the region represented by the current object with the portions of this region and the region defined by the specified path that do not intersect.
void Xor(const SharedPtr<Region>&)Replaces the region represented by the current object with the portions of this region and the specified region that do not intersect.
virtual ~Object()Destroys object. Frees all internal data structures.
virtual ~Region()Destructor.

See Also