Tried yesterday, but not successful...

BitmapPtr icon_bmp = WinGetBitmap(icon_win); // from an offscreen

UInt32 bmp_data_size = 0;
UInt32 bmp_head_size = 0;
BmpGetSizes(icon_bmp, &bmp_data_size, &bmp_head_size);

UInt8 bmp_version = BmpGetVersion(icon_bmp);

void *temp_ptr = NULL;
err = FtrPtrNew('IcOn', 101, bmp_data_size+bmp_head_size, &temp_ptr);
if (err == errNone) {
  err = DmWrite(temp_ptr, 0, (void *) icon_bmp, bmp_data_size+bmp_head_size);
}


but, after reading from the Feature pointer later:

Err err = FtrGet('IcOn', 101, &icon_val);

unsigned char *icon_ptr = (unsigned char *) icon_val;
BitmapPtr icon_bmp = BitmapPtr (icon_ptr);

UInt8 bmp_version = BmpGetVersion(icon_bmp);
UInt32 bmp_data_size = 0;
UInt32 bmp_head_size = 0;
BmpGetSizes(icon_bmp, &bmp_data_size, &bmp_head_size);
                                                        
WinDrawBitmap(icon_bmp, 5, 5);


The bitmap version (from 2 to 0) and bitmap header size (from 24 to 16) is 
changed. The bitmap data size are the same. What is WinDrawBitmap on screen is 
scrambled garbage. What gives?

Thanks
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to