A region represents an arbitary area or set of areas on the drawing coordinate plane; such as structure is widely used in QuickTime to define, for example, clipping or masking areas.
The QTPlgRegion class allows you to manage such as regions using instances of this class.
Since version 6.7 of the plugin this class can be used in Console Applications
The QTPlgRegion class constructors are called when you create a new instance of the class, while the ˜QTPlgRegion class destructor, is called automatically when the class is no more in use. Also, you can invoke the class destructor by setting the instance of the class to nil.
Once a new class instance is returned, it is good practice to check the class property to be sure that the new object can be used. A QTPlgRegion object is valid if it refers to a valid handle in memory (that is the value of the property is not 0)
The class provides you with the following initializer methods:
()
This is the default constructor. This constructor creates a new, variable–size region and initializes
it to the empty region defined by the rectangle (0,0,
0,0)
(other as QTPlgRegion)
This is the copy constructor. The properties of the object to be copied will be used to initialize the
new class instance properties
(r as )
This constructor creates a new, variable–size region and initializes
the new structure to a rectangle that you specify in the r parameter. If the rectangle is
not the result is
the same as the
returns a reference to the handle used by QuickDraw to define regions.
useful for toolbox programmers (use with care: you could invalidate the handle causing unpredictable results
(probably an application crash))
determines whether a region is empty
(r as
)
you can use this function to change the structure of the region to a rectangle that
you specify in the r parameter
(r as
)
you can use this function to change the structure of the region to the oval defined by the
bounding rectangle that you specify in the r parameter
(contour as
)
you can use this function to change the structure of the region to the shape obtained by
joining the points belonging to the contour parameter. To specify that the contour defines a polygon,
simply set the
property of the
class instance to true
(p as picture)
you can use this function to change the structure of the region to the shape obtained from the image specified into the
p parameter.
This method is not available in Console applications
(src as QTPlgRegion)
makes a duplicate copy of the source region defined into src parameter
(src as QTPlgRegion)
use this function to modify the current region by calculating the union of it with that one specified by the
src parameter
(src as QTPlgRegion)
use this function to modify the current region by subtracting from it the region you pass into the
src parameter. If the current region is empty, the resulting region will be an empty region
too
()
use this function to dispose of the current region structure and to re–create a completely new one
(ob as QTPlgRegion)
as QTPlgRegion
use the + Realbasic operator to create a new region by calculating the union of the region in use with
the region you pass into the ob parameter
(ob as QTPlgRegion)
as QTPlgRegion
use the - Realbasic operator to create a new region by subtracting from the region in use
the region you pass into the ob parameter