GpiSetPattern

This function sets the current value of the pattern-symbol attribute.

Syntax
GpiSetPattern (hps, lPatternSymbol)

Parameters

 * hps (HPS) - input : Presentation-space handle.
 * lPatternSymbol (LONG) - input : Pattern symbol.
 * Identifies the shading pattern to be used to fill areas. The pattern that appears depends on the particular pattern set selected by the pattern-set attribute. A value of 0 selects the default pattern and values in the range 1 through 255 select particular patterns within the set.

Possible values if the default pattern set has been selected are shown in the following table:
 * Note:The pattern PATSYM_HALFTONE can be the same as PATSYM_DENSE4. On non bit-mapped devices it may be mapped to another base pattern. If the specified pattern is not valid, the default (device-dependent) pattern is used.

Return Code

 * rc (BOOL) - returns : Success indicator.
 * TRUE Successful completion
 * FALSE Error occurred.

Errors
Possible returns from WinGetLastError
 * PMERR_INV_HPS (0x207F) : An invalid presentation-space handle was specified.
 * PMERR_PS_BUSY (0x20F4) : An attempt was made to access the presentation space from more than one thread simultaneously.
 * PMERR_INV_PATTERN_ATTR (0x20B0) : An invalid pattern symbol attribute value was specified or the default value was explicitly specified with GpiSetAttrs instead of using the defaults mask.

Remarks
Any symbol from a raster font can be used as a pattern by the appropriate use of this function and the GpiSetPatternSet function.

If the current pattern set specifies a bit map (see GpiSetBitmapId and GpiSetPatternSet), the pattern attribute is ignored.

If lPatternSymbol is set or defaulted to PATSYM_SOLID, and the lSet parameter of GpiSetPatternSet is LCID_DEFAULT, pattern colors that are not available may be approximated by dithering (unless dithering has been disabled by setting the LCOL_PURECOLOR bit on the flOptions parameter of GpiCreateLogColorTable).

This function must not be issued in an area or path bracket.

The attribute mode (see GpiSetAttrMode) determines whether the current value of the pattern symbol is preserved.

Graphic Elements and Orders
Element Type: OCODE_GSPT This element type is generated if the attribute mode (see GpiSetAttrMode) is set to AM_NOPRESERVE. Order: Set Pattern Symbol

Element Type: OCODE_GPSPT This element type is generated if the attribute mode is set to AM_PRESERVE. Order: Push and Set Pattern Symbol

Example Code
This function sets the current value of the pattern-symbol to horizontal. This means that when areas are filled, they are filled with a horizontal shading pattern. 
 * 1) define INCL_GPIPRIMITIVES
 * 2) include 

HPS hps;     /* Presentation-space */ /* handle. */

GpiSetPattern(hps,PATSYM_HORIZ); 

Related Functions

 * GpiBeginArea
 * GpiEndArea
 * GpiQueryPattern
 * GpiSetAttrMode
 * GpiSetAttrs
 * GpiSetBackColor
 * GpiSetBackMix
 * GpiSetColor
 * GpiSetDefAttrs
 * GpiSetMix
 * GpiSetPatternRefPoint
 * GpiSetPatternSet