I am creating a test bitmap (160x120 16 bit depth, BitmapV2) and trying to save it as a bitmapRsc resource in a database. I create the bitmap, associate it with a created offscreen window, draw some simple lines. After its created BmpGetSizes results in the expected header size of 24 bytes and data size of (160x120x2) 38400 bytes.
I thought I could write the bitmap to a resource record using the following code:


h = DmNewResource(gImageDbP, bitmapRsc, resId, headerSize+dataSize);
if (h)
{
recP = MemHandleLock(h);
if (recP)
{
// bmpP = BitmapPtr created by BitmapCreate(160, 120, 16, NULL, &error);
DmWrite(recP, 0, bmpP, headerSize);
DmWrite(recP, headerSize, BmpGetBits(bmpP),dataSize);
MemHandleUnlock(h);
}
DmReleaseResource(h);
}


However the resource doesnt display as expected and when BmpGetSizes is called on the resource bitmap it results in a header size of 16 bytes. Anyone know where I've messed up?

Incidentally the aim of all this is to allow the HotSync of such a bitmap resource (created using Veo camera on Tungsten) to a bmp file on the host. So far I am getting really weird results with certain colours (the lighter ones) displaying perfectly but with darker colours coming out as green etc. Does anyone know where I could find code to translate the bitmap properly?

Regards,

Ger

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



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

Reply via email to