SelectClipRgn

Syntax

int SelectClipRgn(hDC,hRgn)

This function selects the given region as the current clipping region for the specified de-vice context. Only a copy of the selected region is used. The region itself can be selected for any number of other device contexts, or it can be deleted.

Parameter Type/Description  

hDC HDC Identifies the device context.  
hRgn HRGN Identifies the region to be selected.  

Return Value

The return value specifies the region's type. It can be any one of the following values:

Value Meaning  

COMPLEXREGION New clipping region has overlapping borders.  
ERROR Device context or region handle is not valid.  
NULLREGION New clipping region is empty.  
SIMPLEREGION New clipping region has no overlapping borders.  

Comments

The SelectClipRgn function assumes that the coordinates for the given region are specified in device units.

Some printer devices support graphics at lower resolutions than text output to increase speed, but at the expense of quality. These devices scale coordinates for graphics so that one graphics device point corresponds to two or four true device points. This scaling factor affects clipping. If a region will be used to clip graphics, its coordinates must be divided down by the scaling factor. If the region will be used to clip text, no scaling adjustment is needed. The scaling factor is determined by using the GETSCALINGFACTOR printer escape.