GreSelectBitmap: Difference between revisions
Appearance
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..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
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. | 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. | This function is supported by the graphics engine. | ||
== Syntax == | == Syntax == | ||
GreSelectBitmap(hdc, hbm, pInstance, lFunction) | GreSelectBitmap(hdc, hbm, pInstance, lFunction) | ||
== Parameters == | == Parameters == | ||
;hdc (HDC) - input | ;hdc (HDC) - input:Device context handle. | ||
:Device context handle. | ;hbm (HBITMAP) - input:Bit-map handle. | ||
;pInstance (PVOID) - input:Pointer to instance data. | |||
;hbm (HBITMAP) - input | ;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreSelectBitmap. | ||
:Bit-map handle. | |||
;pInstance (PVOID) - input | |||
:Pointer to instance data. | |||
;lFunction (ULONG) - input | |||
:High-order WORD=flags; low-order WORD=NGreSelectBitmap. | |||
== Returns == | == Returns == | ||
;rc (HBITMAP) - returns | ;rc (HBITMAP) - returns:On completion, this function returns an HBITMAP value: | ||
:On completion, this function returns an HBITMAP value: | :*HBM_ERROR Error | ||
:*Null Successful | |||
:*HBM_ERROR Error | :*Other Handle of deselected bit map | ||
:*Null Successful | :An error is raised when the bit map: | ||
:*Other Handle of deselected bit map | *Is incompatible with the DC and cannot be converted | ||
*Is already selected into a DC | |||
:An error is raised when the bit map: | *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: | |||
*Is incompatible with the DC and cannot be converted | :*PMERR_BITMAP_IS_SELECTED | ||
*Is already selected into a DC | :*PMERR_DEV_FUNC_NOT_INSTALLED | ||
*Has been assigned a Set ID for use as a pattern in an area fill operation | :*PMERR_HBITMAP_BUSY | ||
:*PMERR_HDC_BUSY | |||
:Possible Errors Detected: | :*PMERR_INSUFFICIENT_MEMORY | ||
:*PMERR_INV_BITMAP_DIMENSION | |||
:*PMERR_BITMAP_IS_SELECTED | :*PMERR_INV_COORDINATE | ||
:*PMERR_DEV_FUNC_NOT_INSTALLED | :*PMERR_INV_HBITMAP | ||
:*PMERR_HBITMAP_BUSY | :*PMERR_INV_HDC | ||
:*PMERR_HDC_BUSY | :*PMERR_INV_HRGN | ||
:*PMERR_INSUFFICIENT_MEMORY | :*PMERR_INV_IN_AREA | ||
:*PMERR_INV_BITMAP_DIMENSION | :*PMERR_INV_IN_PATH | ||
:*PMERR_INV_COORDINATE | :*PMERR_INV_INFO_TABLE | ||
:*PMERR_INV_HBITMAP | :*PMERR_INV_LENGTH_OR_COUNT | ||
:*PMERR_INV_HDC | :*PMERR_INV_RECT | ||
:*PMERR_INV_HRGN | :*PMERR_INV_REGION_CONTROL | ||
:*PMERR_INV_IN_AREA | :*PMERR_INV_SCAN_START | ||
:*PMERR_INV_IN_PATH | :Refer to the "Error Explanations" section of the ''Presentation Manager Programming Reference'' for further explanation. | ||
:*PMERR_INV_INFO_TABLE | |||
:*PMERR_INV_LENGTH_OR_COUNT | |||
:*PMERR_INV_RECT | |||
:*PMERR_INV_REGION_CONTROL | |||
:*PMERR_INV_SCAN_START | |||
:Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation. | |||
== Sample == | == Sample == | ||
Line 67: | Line 52: | ||
HBITMAP rc; /* On completion, this function returns an HBITMAP value: */ | HBITMAP rc; /* On completion, this function returns an HBITMAP value: */ | ||
rc = GreSelectBitmap(hdc, hbm, pInstance, | rc = GreSelectBitmap(hdc, hbm, pInstance, lFunction); | ||
</pre> | </pre> | ||
== Remarks == | == Remarks == | ||
If GreSelectBitmap is called to deselect a bit map, the return code is the handle of the deselected bit map. | 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. | 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. | ||
[[Category:Gre]] | [[Category:Gre]] |
Latest revision as of 23:30, 23 March 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.
Syntax
GreSelectBitmap(hdc, hbm, pInstance, lFunction)
Parameters
- 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.
Returns
- 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:
- PMERR_BITMAP_IS_SELECTED
- PMERR_DEV_FUNC_NOT_INSTALLED
- PMERR_HBITMAP_BUSY
- PMERR_HDC_BUSY
- PMERR_INSUFFICIENT_MEMORY
- PMERR_INV_BITMAP_DIMENSION
- PMERR_INV_COORDINATE
- PMERR_INV_HBITMAP
- PMERR_INV_HDC
- PMERR_INV_HRGN
- PMERR_INV_IN_AREA
- PMERR_INV_IN_PATH
- PMERR_INV_INFO_TABLE
- PMERR_INV_LENGTH_OR_COUNT
- PMERR_INV_RECT
- PMERR_INV_REGION_CONTROL
- PMERR_INV_SCAN_START
- Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.
Sample
#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);
Remarks
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.