Jump to content

GpiSetBitmapId

From EDM2
Revision as of 00:03, 10 May 2017 by Martini (talk | contribs) (Created page with "This function tags a bit map with a local identifier, so that it can be used as a pattern set, containing a single member. ==Syntax== <PRE> rc = GpiSetBitmapId(hps, hbm, lLci...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function tags a bit map with a local identifier, so that it can be used as a pattern set, containing a single member.

Syntax

rc = GpiSetBitmapId(hps, hbm, lLcid);

Parameters

hps (HPS) - input
Presentation-space handle.
hbm (HBITMAP) - input
Bit-map handle.
The bit map must not be currently selected into a device context (see GpiSetBitmap).
lLcid (LONG) - input
Local identifier with which the bit map is to be tagged.
Valid values are in the range 1 through 254.
It is an error if the local identifier is already used to refer to a font or bit map.

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_HBITMAP (0x207B)
An invalid bit-map handle was specified.
PMERR_INV_SETID (0x20CA)
An invalid setid parameter was specified.
PMERR_SETID_IN_USE (0x2102)
An attempt was made to specify a setid that was already in use as the currently selected character, marker or pattern set.
PMERR_BITMAP_IN_USE (0x2008)
An attempt was made either to set a bit map into a device context using GpiSetBitmap while it was already selected into an existing device context, or to tag a bit map with a local pattern set identifier (setid) using GpiSetBitmapId while it was already tagged with an existing setid.
PMERR_HBITMAP_BUSY (0x2032)
An internal bit map busy error was detected. The bit map was locked by one thread during an attempt to access it from another thread.

Remarks

To use the bit map for area shading (or as the pattern in a GpiBitBlt or GpiWCBitBlt operation), a GpiSetPatternSet must be issued with the specified local identifier.

Any bit map of a format supported by the device can be specified. However, it may be simplified before use (see GpiSetPatternSet).

GpiDeleteSetId can subsequently be used to release the tag.

Example Code

This function tags a bit map with a local identifier, so that it can be used as a pattern set, containing a single member.

#define INCL_GPIBITMAPS
#include <OS2.H>

 HPS hps; /* Presentation space handle */
 HBITMAP hbm; /* bit-map handle. */
 LONG lid = 23; /* local identifier. */

GpiSetBitmapId(hps,
               hbm,
               lid);
--------------------------------------------

Related Functions

  • GpiBitBlt
  • GpiCreateBitmap
  • GpiDeleteBitmap
  • GpiDeleteSetId
  • GpiDrawBits
  • GpiLoadBitmap
  • GpiQueryBitmapBits
  • GpiQueryBitmapDimension
  • GpiQueryBitmapHandle
  • GpiQueryBitmapParameters
  • GpiQueryDeviceBitmapFormats
  • GpiSetBitmap
  • GpiSetBitmapBits
  • GpiSetBitmapDimension
  • GpiSetPatternSet
  • GpiWCBitBlt