> MemHandle hMousePad;
> BitmapType *pMousePad;
> MemHandle win;
>
> hMousePad = DmGetResource('Tbmp',MousePad); file://MousePad is the image
>
> if(hMousePad!= NULL)
> {
> pMousePad=(BitmapPtr)MemHandleLock(hMousePad);
> win=WinCreateBitmapWindow(pMousePad,&error);
> if (error) ErrAlert(error);
> WinSetDrawWindow(win);
> ...
> ...
> }
>
> I found some problems:
> a. pilrc complains some varibles of the bitmap missing;
> b. "ErrAlert" complains sys0502>From SystemMgr.h : error 502 is sysErrParamErr. From the documentation for WinCreateBitmapWindow : "The bitmapP parameter is invalid. The bitmap must be uncompressed and it must have a valid pixel size (1, 2, 4, or 8). It must not be the screen bitmap." BTW, you cannot draw onto a bitmap that is located in the storage heap. If you really want to dynamically change the bitmap, you'll have to copy it to dynamic heap first. If you just want to draw the bitmap on the screen, use WinDrawBitmap. Pascal -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
