Thanks Richard - using a Bitmap Family was the answer. For future
reference, here's what I did in Constructor:
1) Delete the original Form Bitmap from the Form and save the project
(I had some weird Constructor effects until I did this).
2) Create 3 bitmaps, at 1-, 2- and 8-bit depth, with resource IDs xxx1,
xxx2 and xxx8 (1101, 1102 and 1108 in my case)
3) Create a bitmap family and add 3 family items to refer to the 3
bitmaps created in (2). The Bitmap Family's resource ID has no
relationship to the Bitmap resource IDs; I used 1000.
4) Add a Form Bitmap to the form, and set the Form Bitmap's resource ID
to the Bitmap Family created in (3), 1000 in my case.
That's it - the form now shows the right bitmap automagically (i.e. the
system sorts out 1/2/8-bit depth).
So, two supplemental questions:
1) why does the PalmOS sample code use 1/2/8-bit icon/bitmaps but not
4-bit ? Because no device has a 4-bit display ?
2) What Palm device has a 2-bit display ?
John.
Richard Burmeister wrote:
>
> From: "John Cundall" <[EMAIL PROTECTED]>
> Subject: Colour bitmap in Alert
>
> > my question is, what do I have to do to get a colour bitmap to draw in
> > colour *in a dialog* ?
>
> That shouldn't cause any problems. Are you using a Bitmap Family for the
> bitmap? If so, you don't have to check the screen mode; the OS takes care
> of selecting the proper bitmap for the current screen depth.
>
> Here's code I use to display a modal dialog box, given the id of a form:
>
> static UInt16 ShowModalDialog( UInt16 frmID )
> {
> FormPtr prevForm, thisForm;
> UInt16 btn;
>
> prevForm = FrmGetActiveForm();
> thisForm = FrmInitForm( frmID );
> FrmSetActiveForm( thisForm );
> btn = FrmDoDialog( thisForm );
> if ( prevForm )
> FrmSetActiveForm( prevForm );
> FrmDeleteForm( thisForm );
> return btn;
> } // ShowModalDialog
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/