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.
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; }