are you accessing the bitmaps through the bitmap family?


-----Original Message-----
From: Mike Montalvo [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 28, 2000 1:12 PM
To: Palm Developer Forum
Subject: Re: bitmap


> Bitmaps just don't work that way in PalmOS... also, hiding/showing bitmaps
> doesn't work either.

The code in my first post that changes the rscID in the FormBitmapType
structure does work.  You can flip back and forth (at least once) between
showing the light on or light off bitmap in the same form bitmap resource.
Since the 'light on' and 'light off' bitmaps are the same size, you can just
redraw the bitmap over the old one.

Whether or not this technique that I'm using has something to do with the
error, I dont know.  At this point I think it does.  The 'object not in
form' error only occurs on lights that Ive changed.  Thats why it only
happens the second time through.  I've checked the frm pointer value and its
the same the first and second time through.  But I will use FrmGetFormPtr()
instead and see if it makes a difference.

So what I'm thinking is maybe FrmGetObjectIndex() uses the information from
the original form bitmap resource (my DiagACClutchBitMap) and tries to match
it up with the objects in the form.  Since I've changed the rscID of the
DiagACClutchBitMap form bitmap, it cant find a matching one.  Hence the
error.  Can anyone confirm the behaviour of FrmGetObjectIndex()?

Well, I just read up a little and see that there is a warning about using
FrmGetObjectIndex() when you have more than one form bitmap associated with
the same bitmap resource.  Which results from having to pass the bitmap
resource ID, not the form bitmap object ID (like I'm doing)  DOH!
Newbie-ism strikes again.

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

I think I'm just going to throw in the towel and put 12 bitmaps on the
form...

-Mike







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

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