Sign in Join
FPDoc Onlineexperiment

TRegion class

In unit Graphics

A defined area on a screen or canvas used to render a graphic image or text output.

Declaration

pascal
TRegion = class(TGraphicsObject)

Inheritance

  1. TRegion
  2. TGraphicsObject
  3. TPersistent
  4. TObject

Description

TRegion is a TGraphicsObject descendant which represents shaped areas that can be drawn, filled, or examined on a screen or canvas. The shaped areas can be one or more rectangles, and can overlap.

Use AddRectangle to create and combine a new rectangular area with the existing areas in the region. Each region has a Handle which identifies the construct. It is modified when a new rectangular area is added to the region.

TRegion is the type used to implement the Region propriety in TCanvas, and passed as an argument to the SetShape method in TWinControl.

Some operating systems and widgetsets allow regions to be defined with ellipses, rounded rectangles, and polygons as the sub-regions. TRegion is limited to the rectangle with the area that is the bounding box for a shape. See TLazRegion in LazRegions.pas and TLazCanvas in LazCanvas.pas for alternate implementations that provide these capabilities.

Properties

ClipRectpublicThe clipping rectangle for the region.
ReferencepublicA Reference to the current Region.

Methods

SetClipRectprotectedSets the value for the ClipRect property.
GetClipRectprotectedGets the value for the ClipRect property.
CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.
AssignpublicAssign - if Source is another TRegion, copies the dimensions of the clipping rectangle.
AddRectanglepublicConvenience routine to add a rectangle to the region.

Inherited

From TGraphicsObject (6)

Changed Changing Lock OnChange OnChanging UnLock

From TPersistent (7)

AssignTo DefineProperties FPOAttachObserver FPODetachObserver FPONotifyObservers GetNamePath GetOwner

From TObject (40)

AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.