> > Instead, set up 6 gadgets with the same dimension as your light bitmap.
> On
> > the FrmOpen/FrmUpdate events, after FrmDrawForm() is called, loop
through
> > the gadgets and use WinDrawBitmap to draw the appropriate light.  Its
> easy,
> > and it avoids sillyness with extra bitmap objects on the form.
>
> I must have really missed something.  I've used gadgets for graphic
> 'buttons'.  I create a form bitmap and then create a gadget on top of it.
> (This was before I realized I could use a frameless button control) But
what
> you said above, I dont understand what the gadget is for.  Dont you need
to
> have a form bitmap in the form in order to use WinDrawBitmap anyway?  I
dont
> see how using a gadget has reduced the amount of form bitmaps.

You NEVER need a form bitmap.  This is really just a record in the form
structure that tells the PalmOS to draw the linked bitmap there.
WinDrawBitmap is below the form level -- it just draws a bitmap in memory to
the screen, and its perfectly happy to draw any random bitmap you have in
your resources after you've found the resource, locked it in place, and cast
it to the appropriate type.

Here's some sample code (taken from a game on which I'm working):

MemHandle devilBunnyH = DmGetResource(bitmapRsc, DevilBunnySmallBitmap);
WinDrawBitmap(bitmap, x, y);
DmReleaseResource(devilBunnyH);

The idea for the gadgets is to allow you to layout where your dynamic
bitmaps will be at design time, then use PalmOS calls to get their positions
to set the x.y coordinate where your bitmaps will be drawn.

--
Ben Combee
Veriprise Wireless <http://www.veriprise.com>



-- 
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