Ok. So I have some more info on this problem. The problem is that
16-bit transparency does not work properly on OS 5.0. This problem
seems to be fixed in OS 5.1.

On OS 5.0,
-16-bit transparency only works for black. If you use a non-zero color
for the transparency, it will not be honored in WinDrawBitmap or
WinPaintBitmap. 

Workaround:
-I found a "less than ideal" workaround for this problem. What I do is
create an offscreen window and set the transparency for this window
manually using BmpSetTransparency. It seems to take a 16bit value
created from an rgb value (5 bits of red, 6 bits of green, 5 bits of
blue). I then use WinDrawBitmap or WinPaintBitmap to move the bitmap
from my resource to this window. After that, I use WinCopyRect
(winPaint mode) to move this bitmap from the offscreen window to the
final destination window. WinCopyRect seems to honor the
transparency properly.

If someone has a better workaround - please let me know. It bothers me
to have to alloc an offscreen window just make sure transparency works
properly. 

Thanks to Andy Stewart at PalmSource for his help.

-Mark




On Thu, Oct 31, 2002 at 11:59:06AM -0800, Mark Palatucci wrote:
> Hello,
> 
> I am having an interesting transparency problem when I run my
> application on the new Tungsten T device.
> 
> I have certain bitmaps that use (255,0,255) as a transparency
> color. On the TT (which I got yesterday), the transparent color is
> actually painted over whatever is below it! While this creates some
> interesting visuals, it is not quite what I'm looking for..:)
> 
> This problem does not occur in the OS 5 simulator (debug or release
> roms) or any color OS 4.x devices. 
> 
> Has anyone else encountered this problem? 
> 
> Some additional info:
> -I am not using any double density bitmaps
> -All my bitmaps are 16bit. 
> -My app only runs on 16bit or higher color devices. 
> 
> My guess here is that the blitter that scales the single density
> bitmaps does not properly handle the transparency. Since I paint into
> an offscreen window (using nativeFormat) first - perhaps my window
> type is wrong? 
> 
> Any ideas would be most appreciated..
> 
> -Mark
> 
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe, please see 
>http://www.palmos.com/dev/support/forums/

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

Reply via email to