Definition of a Region

Last reviewed: July 22, 1997
Article ID: Q10212
3.00 3.10 WINDOWS kbprg kbref kbdocerr

The information in this article applies to:

  • Microsoft Windows Software Development Kit for Windows versions 3.0 and 3.1

SUMMARY

The term "region" is used throughout the Windows documentation; however, the term is not defined. This article explains regions, how they are used, and how a region is defined or specified.

MORE INFORMATION

Unlike most graphics packages that can manipulate only simple geometric structures (usually rectilinear), The Windows graphics device interface (GDI) has the unique ability to gather an arbitrary set of spatially coherent points into a structure called a region, and perform complex yet rapid manipulations and calculations on such structures. This feature not only makes standard programs simpler and faster, it also allows operations to be performed that would otherwise be nearly impossible (for example, it is fundamental to the implementation of the Windows user interface).

Although most GDI function parameters are given in logical units and then are converted to device units, region function parameters are given in device units.

A region is defined by defining lines, shapes (such as rectangles and ellipses), or other regions. The outline of a region should be one or more closed loops. A region can be concave or convex, can consist of one area or many disjoint areas, and can have "holes" in the middle.

Many calculations can be performed on regions. For example, given any two regions, GDI can find their union, intersection, difference, and exclusive. There is a set of graphic operations on regions to draw them on the screen.

When a region is selected into a device context (DC), a new clipping area is created. Any graphics sent to that DC will be clipped to the region created. Regions are defined using CreateRectRgn(), CreateEllipticRgn(), and CreatePolygonRgn().


Additional reference words: 3.00 3.10
KBCategory: kbprg kbref kbdocerr
KBSubcategory: GdiDrw
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.