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.
GpiSetPattern (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_GPIPRIMITIVES
BOOL GpiSetPattern(hps, lSymbol)
HPS hps; /* presentation-space handle */
LONG lSymbol; /* shading pattern */
The GpiSetPattern function sets the current value of the pattern attribute.
The pattern attribute specifies the shading pattern used to fill areas. The
pattern can be any pattern from the default pattern set or any character
from a raster font. If the specified pattern is not valid for the device
associated with the presentation space, the function sets the default
pattern.
If the attribute mode is AM_PRESERVE, the function saves the previous
pattern attribute on the attribute stack when it sets the new pattern. The
previous pattern attribute can be retrieved using the GpiPop function.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hps Identifies the presentation space.
lSymbol Specifies the shading pattern to set. The values depend on the
particular pattern set selected by the pattern-set attribute. It
can be zero to specify the default pattern, or a number in the
range 1 through 255 to specify a particular pattern from the
current pattern set. If the default pattern set is used, it can
be one of the following values:
Value Meaning
─────────────────────────────────────────────────────────────────
PATSYM_BLANK Blank pattern (background only)
PATSYM_DEFAULT Default pattern (device-dependent)
PATSYM_DENSE1 Density-1 pattern (mostly foreground)
PATSYM_DENSE2 Density-2 pattern
PATSYM_DENSE3 Density-3 pattern
PATSYM_DENSE4 Density-4 pattern
PATSYM_DENSE5 Density-5 pattern
PATSYM_DENSE6 Density-6 pattern
PATSYM_DENSE7 Density-7 pattern
PATSYM_DENSE8 Density-8 pattern (mostly background)
PATSYM_DIAG1 Upward-diagonal pattern (steep)
PATSYM_DIAG2 Upward-diagonal pattern (gradual)
PATSYM_DIAG3 Downward-diagonal pattern (steep)
PATSYM_DIAG4 Downward-diagonal pattern (gradual)
PATSYM_HALFTONE Alternating foreground and background pattern
PATSYM_HORIZ Horizontal pattern
PATSYM_NOSHADE Blank pattern (background only)
PATSYM_SOLID Solid pattern (foreground only)
PATSYM_VERT Vertical pattern
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
If the current pattern set specifies a bitmap (see the GpiSetBitmapId or
GpiSetPatternSet function), the pattern attribute is ignored.
See Also
GpiQueryPattern, GpiSetBitmapId, GpiSetPatternRefPoint, GpiSetPatternSet,
WinGetLastError
♦