wpQueryBitmapData
Appearance
This method is specific to Version 4, or higher, of the OS/2 operating system.
This instance method returns the pointer to the bitmap data for the image file.
Syntax
_wpQueryBitmapData(somSelf, pulSize)
Parameters
- somSelf (WPBitmap *) - input
- Pointer to the object on which the method is being invoked.
- Points to an object of class WPBitmap.
- pulSize (ULONG *) - in/out
- Pointer to the number of bytes in the bitmap data.
Returns
- rc (PBYTE) - returns
- Pointer to the bitmap data.
- A return value of **NULL** indicates unsuccessful completion.
How to Override
This method must be overridden in any subclass of **WPImageFile**.
Usage
The Workplace Shell calls the **wpQueryBitmapData** method whenever it needs to access the raw data for a bitmap represented by a WPImageFile object.
Remarks
This example shows how the **WPBitmap** class returns the data for a bitmap object. The wpReadImageFile method reads the bitmap data from the data file and sets the instance variables **_pBitmapData** to point to the bitmap data and **_ulBitmapDataSize** to the size of the bitmap data.
Example Code
SOM_Scope PBYTE bmp_wpQueryBitmapData(WPBitmap *somSelf,
ULONG *pulSize)
{
WPBitmapData *somThis = WPBitmapGetData(somSelf);
/* Read the data from the bitmap file */
_wpReadImageFile(somSelf);
/* Pass the data back to the caller */
if(pulSize)
{
*pulSize = _ulBitmapDataSize;
}
return _pBitmapData;
}