GreDeviceDeleteBitmap

From EDM2
Jump to: navigation, search

GreDeviceDeleteBitmap destroys a bit map.

This function must be supported by the presentation driver.

Simulation support
None. This function is mandatory for all drivers.

Syntax

GreDeviceDeleteBitmap(hdc, hbm, pReturns, flOptions, pInstance, lFunction)

Parameters

hdc (HDC) - input
Reserved.
Note
The handling routine must not use the value passed on the stack in the location reserved for hdc. This location contains undefined data.
hbm (ULONG) - input
Handle of the bit map to be destroyed.
pReturns (PDELETERETURN) - input
Pointer to returned bit-map parameters.
Pointer to a DELETERETURN structure, which consists of the following fields:
  • pInfo Pointer to a BITMAPINFO or BITMAPINFO2 structure
  • pBits Pointer to bit map
flOptions (ULONG) - input
Additional information used by the engine when creating or deleting a bit map. The only valid flag is:
CBM_INIT When set, bit-map parameters must be returned in pReturns. This means that before deleting the bit map, the handling routine must translate it into one of the standard formats. The presentation driver must then allocate two blocks of memory, one for the bit map and another for the bit-map parameters and color translation table. The presentation driver can use any of the standard formats. However, it must take into account the parameters originally specified in GreDeviceCreateBitmap. The handling routine should use the format that uses the least amount of memory without losing any bit-map information.
When this flag is not set, bit-map data is not returned.
Other flags are reserved and should be ignored by the handling routine.
pInstance (ULONG) - input
Reserved.
Note
The handling routine must not use the value passed on the stack in the location reserved for pInstance. This location contains undefined data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreDeviceDeleteBitmap.

Returns

rc (BOOL) - returns
Return Codes.
On completion, the handling routine must return a BOOLEAN value to indicate success or an error.
  • TRUE Successful
  • FALSE Error

Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:

  • PMERR_DEV_FUNC_NOT_INSTALLED
  • PMERR_INSUFFICIENT_MEMORY
  • PMERR_INV_HDC
  • PMERR_INV_INFO_TABLE
  • PMERR_INV_LENGTH_OR_COUNT
  • PMERR_INV_SCAN_START

Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Sample

#define INCL_GRE_BITMAPS
#include <os2.h>

HDC              hdc;        /*  Reserved. */
ULONG            hbm;        /*  Handle of the bit map to be destroyed. */
PDELETERETURN    pReturns;   /*  Pointer to returned bit-map parameters. */
ULONG            flOptions;
ULONG            pInstance;  /*  Reserved. */
ULONG            lFunction;
BOOL             rc;         /*  Return Codes. */

rc = GreDeviceDeleteBitmap(hdc, hbm, pReturns,
       flOptions, pInstance, lFunction);