I'm having trouble accessing the bitmap in an offscreen bitmap window when
it contains a hi density bitmap.
The following code works fine on the first pass when the WinHandle
'nightScreen' does not exist and the code has to make the bitmap from
scratch, but on a later pass when it's just trying to access the bitmap in
an already created window it gives invalid data for the bitmap reference.
The code does however work fine with a non high density bitmap.
I have included the BitmapRsrc.c and .h files from the BitmapRsrcDR1 project
into my project (hence the otherwise unavailable types and functions).
BmpRsrc is a BmpRsrcType.
Ty,
Darren Beck
-Code City
if (!nightScreen)
{
if (density == 2)
// create double density bitmap
{
bmpRsrc = BmpRsrcCreate ( 160 * density, // width
100 * density, // height
16, // pixel size
NULL, // color table
kDensityDouble, // density
pixelFormat565LE//pixel format
);
}
else
// create single density bitmap
{
bmpRsrc = (BmpRsrcType*) BmpCreate (160, 100, 16, NULL, &err);
}
nightScreen = WinCreateBitmapWindow ((BitmapType*)bmpRsrc, &err);
frontWin = WinSetDrawWindow (nightScreen);
DrawHDMap ();
}
else
{
frontWin = WinSetDrawWindow (nightScreen);
bmpRsrc = (BmpRsrcType*) WinGetBitmap (nightScreen);
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/