gpi12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
GpiSetPatternSet (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPIPRIMITIVES
 
BOOL GpiSetPatternSet(hps, lcid)
HPS hps;      /* presentation-space handle */
LONG lcid;    /* local identifier          */
 
The GpiSetPatternSet function sets the current pattern-set attribute to the
specified value. The pattern set specifies the pattern or character set from
which patterns can be chosen. The pattern set can be the default pattern
set, any logical font created using the GpiCreateLogFont function, or any
tagged bitmap.
 
If a logical font is set as the pattern set, the GpiSetPattern function can
be used to choose which character in the font as the pattern. Depending on
the device associated with the presentation space, not all of the character
may be used as the pattern. For example, some devices use only 8-by-8
patterns, and therefore use only the lower-left corner of a character.
 
If a tagged bitmap is set as the pattern set, the bitmap is used as the
pattern. As with characters, not all of the bitmap may be used as the
pattern. Also, if the bitmap is color and the device is monochrome, the
system converts the bitmap to monochrome.
 
If the attribute mode is AM_PRESERVE, the function saves the previous
pattern-set attribute on the attribute stack when it sets the new pattern
set. The previous pattern-set attribute can be retrieved using the GpiPop
function.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hps        Identifies the presentation space.
 
lcid       Specifies the local identifier for the pattern set. It can be any
           integer in the range 1 through 254 for which a logical font or
           tagged bitmap has been created. It can be LCID_DEFAULT to specify
           the default pattern set.
 
Return Value
 
The return value is GPI_OK if the function is successful or GPI_ERROR if an
error occurred.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
 
     PMERR_INV_HPS
     PMERR_INV_PATTERN_ATTR
     PMERR_INV_PATTERN_SET_ATTR
     PMERR_PS_BUSY
 
Comments
 
Certain fonts cannot be used for patterns. The function returns an error if
an application attempts to set such a font as the pattern set. Fonts that
cannot be used as patterns include device fonts which cannot be used for
shading, and any kind of raster font used for a plotter device.
 
See Also
 
GpiQueryPatternSet, GpiSetPattern, GpiSetPatternRefPoint, WinGetLastError