Here's one way, dunno if it's the *best* way... I've got 4 bitmaps defined with ids:
1200...1500. Each one is a progression of an
animation sequence.
// since comm is successful, animate the satellite icon
if (++SatelliteIcon>3) SatelliteIcon=0;
SatelliteIconID = 1200 + (100*SatelliteIcon);
DrawBitmap ( NULL ,SatelliteIconID,134,63);
where DrawBitmap is shamelessly plagarized (sp?) from I forget where, probably Neil
Rhodes book....
/***********************************************************************
*
* FUNCTION: DrawBitmap
*
* DESCRIPTION: Convenience routine to draw a bitmap at specified location
*
* PARAMETERS: winHandle -- handle of window to draw to (0 for current window)
* resID -- bitmap resource id
* x, y -- bitmap origin relative to current window
*
* RETURNED: nothing.
*
*
***********************************************************************/
void DrawBitmap(WinHandle winHandle, Int resID, Short x, Short y)
{
Handle resH;
BitmapPtr resP;
WinHandle currDrawWindow;
// If passed a non-null window handle, set it up as the draw window, saving
// the current draw window
if ( winHandle )
currDrawWindow = WinSetDrawWindow( winHandle );
resH = DmGetResource( bitmapRsc, resID );
ErrFatalDisplayIf( !resH, "no bitmap" );
resP = MemHandleLock(resH);
WinDrawBitmap (resP, x, y);
MemPtrUnlock(resP);
DmReleaseResource( resH );
// Restore the current draw window
if ( winHandle )
WinSetDrawWindow( currDrawWindow );
}
-----Original Message-----
From: Ingo Brueckl <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, March 15, 1999 5:57 PM
Subject: Form Bitmap
Maybe I'm blind but I can't find functions for what I intend to do in the
documentation.
I have a form bitmap and several bitmap resources. How can I dynamically
change the bitmap resource ID of the from bitmap, so that the bitmap
displayed changes? Before drawing the form, obtaining a BitmapPtr b and
setting b->flags.reserved works, but this surely isn't what I am supposed
to do, is it?
Ingo