Microsoft Windows CE 3.0  

Clipping Regions

This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

You can use clipping regions to restrict your output to a specified subregion of the client area. To use a clipping region, you must select it into the device context associated with the display device.

Clipping is used in Windows CE in a variety of ways. Word processing and spreadsheet applications clip keyboard input to keep it from appearing in the margins of a page or spreadsheet. Computer-aided design and drawing applications clip graphics output to keep it from overwriting the edges of a drawing or picture.

Some device contexts provide a predefined or default clipping region. For example, the device context created by the BeginPaintfunction contains a predefined rectangular clipping region that corresponds to the invalid rectangle to be repainted. However, the device contexts created by the CreateDCand GetDCfunctions contain empty clipping regions; clipping is done only to keep graphics output in the window client area.

You can perform a variety of operations on clipping regions. Some of these operations require a handle identifying the region and some do not. For example, you can perform the following operations directly on a device context clipping region: