Hi,
-I have a few experiences in use color palette.
The best way to use palette color: You should use
WinPalette() to set palette color only one, ex. at
StartApp(). That you have change all palette of images
you use with a standar or common Palette color. You
can do that by use Photoshop or any Bitmap utiliti
tool.
-But with your current, you can use WinFillRectangle()
to solve that problem.
-Do not use FrmEraseForm(0 o WinEraseWindow().
-You should set paleete color before call
FrmDrawForm().
- Notice that: the system use own FormFrameColor,
FormFillColor... so you must sure your custom palette
already have this entry color.
- By the way, how can you use palette color with
compress bitmap?
Cheers,
> -----Original Message-----
> From: [EMAIL PROTECTED]
>
[mailto:[EMAIL PROTECTED]]On
> Behalf Of Kelly
> Morrison
> Sent: Thursday, August 23, 2001 17:23
> To: Palm Developer Forum
> Subject: The fine art of palette switching
>
>
> I'm trying to eliminate a temporary "false color"
> flash when changing
> from one form with a custom palette to another form
> with a different custom
> palette, and I was looking for advice on the best
> way to accomplish this.
>
> Basically, I have an application with several
> screens, each with its own
> custom palette. I hacked pilrc to produce bitmaps
> that use my custom
> palettes without embedding the palettes themselves
> in the Tbmp resources, so
> they load and display quickly, and I can set the
> palette using WinPalette()
> and view the bitmaps with no problem: they look
> great. Unfortunately, I'm
> having problems figuring out *where* to change
> palettes so I don't get a
> quick glimpse of the image with false colors. Using
> a common palette for all
> of the forms in my application is not an option (the
> bitmaps are very
> different).
>
> Here's what I tried so far:
>
> 1. Setting the custom palette before FrmDrawForm()
> in frmOpenEvent.
> Not only does this violate Palm's programming
> rules, I get errors in
> POSE. So much for this one.
>
> 2. Setting the custom palette after FrmDrawForm() in
> frmOpenEvent.
> No good. FrmDrawForm() draws the resouces in my
> .rcp file, and when I
> switch the palette afterwards, they don't show
> properly. I could probably
> update the screen here, but it seems inefficient and
> wasteful to have the
> screen draw twice in a row at the beginning of each
> form load. Similarly, I
> know there's an event generated when the palette
> changes, so I could refresh
> the screen when I get that event, but again... it
> seems wasteful for the
> form to have to draw twice in a row.
>
> 3. Erasing the form and then switching palettes in
> frmCloseEvent.
> I tried using FrmEraseForm() after getting a
> frmCloseEvent. Nope, got an
> error about not having a drawing surface.
>
> 4. Setting the palette to all whites or all blacks
> in frmCloseEvent.
> This hides the image and gives me a blank screen
> until the next form is
> drawn. Unfortunately, it takes me right back to
> problem #2 above when I load
> the next form, and worse, I now have to remember to
> set either a custom
> palette or the standard palette at the beginning of
> each form that might
> load next.
>
> Any suggestions? It feels like I'm *so* close I can
> taste it. :) Thanks in
> advance for any help!!!
>
> ------> kell
>
> P.S. I just *know* I'm going to have a similar
> problem with system dialogs
> (e.g., "Find") popping up when I have a custom
> palette installed... :)
>
>
>
>
> --
> 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/
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/