Have you tried using WinSaveBits/WinRestoreBits?

Call WinSaveBits to grab the bits that will be covered by your bitmap. Draw 
your bitmap, then when you're ready to remove it simply put back the 
original bits with WinRestoreBits.

The only caveat is that if your display changes in some way other than the 
displaying of the bitmap, when you restore the original bits you'll get an 
outdated image. Just like the problem you can get if you have a clock or 
animation running in the menu status area.

HTH,
Gavin.

>Subject: Help with FrmNewBitmap for an Hourglass
>From: "Jeff Ishaq" <[EMAIL PROTECTED]>
>Date: Sun, 10 Sep 2000 17:49:59 -0400
>X-Message-Number: 13
>
>Hey folks.  I searched the example code and knowledgebase for info on this
>API, without success.
>
>I'd like to display an hourglass on the form during a short (1 to
>1.5-second) operation, and then undraw it.  I am concerned about doing this
>as quickly as possible, to eliminate any flicker that may result from
>operations that take very little time.
>
>The first thing I thought of was creating a bitmap family in C'Tor, and
>using DmGetResource() and WinDrawBitmap().  This works fine, but I realized
>quickly that I would need manually to store the bits 'behind' where the
>bitmap will go before I WinDrawBitmap(), and then restore them.  Having
>never done this, I realized that it might be easier if I could just make a
>new Form Bitmap, and then hide/show it using FrmShowObject() and
>FrmHideObject().
>
>But I can't seem to get it to work.  POSEr crashes on me when I try
>'FrmShowObject', complaining about reading from an unallocated chunk of
>memory.
>
>Can someone show me the trick?  I'm not sure what the two different IDs are
>in the FrmNewBitmap call, I suspect they the culprit.
>
>In Constructor, I created a 1-bit Hourglass1Bitmap as a PICT resource, ID
>1000, and then a HourglassBitmapFamily as a tbmf resource, ID 1000.  The
>tbmf references the PICT.
>
>
>FormPtr pForm = FrmGetActiveForm();
>FormBitmapType* pFrmBMP =
>FrmNewBitmap( &pForm,  resIdOne, resIdTwo, x, y );

>
>FrmShowObject (pForm, resIdTwo);
>
>I'm not sure if this is the wrong approach, and what I should be using for
>resIdOne and resIdTwo.
>
>Can someone clue me in please?
>-Jeff Ishaq


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

Reply via email to