System Implementation

Regions are device-dependent objects and, therefore, are associated with a particular device. For this reason, when an application specifies a presentation space as input to one of the region functions, that presentation space must be associated with a device context. The associated device context serves to identify the device. Because a region is specific to the device for which it was created, a region should not be created for one device and then used for another.

If the device is a printer, a metafile can be used to store region functions as escapes, and the resulting metafile can be displayed on any device. The appearance of the result of any region function is affected by differences in the pel:aspect ratio and device resolution on different printers.

Most of the region-oriented functions use the RECTL structure to define the device-space coordinates of the rectangle. When an application creates a rectangle in a device space and passes its coordinates to a region function, the operating system excludes the top and rightmost edges of the rectangle. This means that an application must add 1 to the values in the xRight and yTop fields of the RECTL structure to obtain the desired dimensions. For example, if an application requires a region that measures 100-by-100 device units, with a lower-left corner at (10,10), xRight and yTop should be set to 111 instead of 110.


[Back: About Regions]
[Next: Region Attributes]