At 8:42 AM +0100 16-03-00, Shannon wrote:
>Did you think about specifying a color for transparency? Depending on how
>you are doing it, that might work. That is the only OS supported way I
>know of to dynamically substitute one color for another, although perhaps
>drawing the bitmap with one of the new drawing modes would work.
>
>The other way to do it might be to attach a color table to the bitmap, and
>change the color in question dynamically.


There's no index that you can use to mean one of the UI colors.  So that
idea is out.

Transparency may work for getting the background color right, which
probably covers 90% of the cases that aren't covered by the automatic
foreground/background application to 1-bpp bitmaps.

If you really need to go beyond this, I think you'll have to draw into an
off-screen bitmap, then use the winSwap WinDrawOperation repeatedly to
munge the colors to what you want.  winSwap trades the background and
foreground colors for only pixels that were the background and foreground.
Of course, that's still problematic, because you may end up recoloring your
own pixels that were in the current UI color to the old color...  (winSwap
is sort of a cheap attempt to give you a color version of winInvert)

What we really need is a blitter-type routine that will take a translation
table and apply it to all pixels in a bitmap.  The effect would be sort of
like you'd get when you animate the palette, but you'd actually be changing
the index values, so it'd be slower but permanent.

                                        --Bob



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to