Hi,

I'm running into similar problems. I'm also trying to load and uncompress a
bitmap resource into an offscreen window, in order to modify its bits.
Knowing that BmpCompress does not work (or at least I could not have it to
work), I use the following code (error checking and other stuff removed to
reduce this snippet to the minimal code that reproduces the bug):

void Test()
{
  BitmapType  * res, * bmp;
  MemHandle     hbm;
  WinHandle     hwin, hprev;
  RectangleType rc;
  Err           err;

  hbm=DmGetResource('Tbmp',1003);
  res=(BitmapType *) MemHandleLock(hbm);

  bmp=BmpCreate(128,22,1,NULL,&err);
  hwin=WinCreateBitmapWindow(bmp,&err);

  hprev=WinSetDrawWindow(hwin);
  WinDrawBitmap(res,0,0);
  WinSetDrawWindow(hprev);

  MemHandleUnlock(hbm);

  rc.topLeft.x=0;
  rc.topLeft.y=0;
  rc.extent.x=128;
  rc.extent.y=22;
  WinCopyRectangle(hwin,0,&rc,0,0,winPaint);

  WinDeleteWindow(hwin,false);
  BmpDelete(bmp);
}

The 'Tbmp' 1003 resource is a monochrome 128x22 single bitmap. This works
fine on the Simulator 5R3, but displays garbage on real devices (T, T3, and
Zire).

Is there something wrong with this code, or does the OS5 blitter fail to
copy monochrome bitmaps ?

Pascal




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

Reply via email to