Difference between revisions of "GreSelectBitmap"
(Created page with "GreSelectBitmap selects a bit map into a memory DC or (if called with a NULL bit-map handle) deselects the existing bit map from the DC. This function is supported by the gr...")
Revision as of 03:25, 16 January 2020
GreSelectBitmap selects a bit map into a memory DC or (if called with a NULL bit-map handle) deselects the existing bit map from the DC.
This function is supported by the graphics engine.
GreSelectBitmap(hdc, hbm, pInstance, lFunction);
- hdc (HDC) - input
- Device context handle.
- hbm (HBITMAP) - input
- Bit-map handle.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreSelectBitmap.
- rc (HBITMAP) - returns
- On completion, this function returns an HBITMAP value:
- HBM_ERROR Error
- Null Successful
- Other Handle of deselected bit map
- An error is raised when the bit map:
- Is incompatible with the DC and cannot be converted
- Is already selected into a DC
- Has been assigned a Set ID for use as a pattern in an area fill operation
- Possible Errors Detected: Error codes posted by the graphics engine for this function include:
- Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.
#define INCL_GRE_DEVSUPPORT #include <os2.h> HDC hdc; /* Device context handle. */ HBITMAP hbm; /* Bit-map handle. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGreSelectBitmap. */ HBITMAP rc; /* On completion, this function returns an HBITMAP value: */ rc = GreSelectBitmap(hdc, hbm, pInstance, lFunction);
If GreSelectBitmap is called to deselect a bit map, the return code is the handle of the deselected bit map.
When created, a bit map has to be selected into a DC before the presentation driver can write to it. A bit map can be selected into the DC that created it or into any DC that has a compatible bit-map format. Compatibility can be ensured by using one of the standard formats. Note that the presentation driver must select a bit map into a device context before attempting to draw it.