On Mon, 2002-10-21 at 04:50, Dan wrote:
> Hi everyone.  I am looking to place a bitmap on an offscreen surface using a
> transparent color key.  Now, according to the documentation, you cannot set
> a transparent color key with the BmpGlueSetTransparentValue( ) that will
> work on offscreen surfaces.  Why is this?  Is there a way around this?  I am
> aware of the masking technique often used in simple Windows GDI programming;
> however, that is a very antiquated way of achieving transparency nowadays.
> Does anyone have suggestions how I should go about doing this?  I do not
> want to give up double-buffering because the graphics will surely flicker.
> 
> FYI, I am trying to run on an 8-bit color Palm platform.  Although, I would
> be interested in how to do this for different color depths if there are
> differences.

Hiya Dan,

I've got a single large bitmap with many of my graphics inside. I'm
loading this once, and then painting various parts of it to the screen.

I tried a few things, but the only thing I got to work on a majority of
devices was:
1) call WinCreateOffscreenWindow
2) draw the bitmaps in question into that (forget the transparency for a
second).
3) call BmpGlueSetTransparentValue( ) as appropriate on this offscreen
window.
4) Now, call WinCopyRectangle(..., winPaint) as appropriate to draw the
graphic.

Note that this works on all devices in POSE, but /not/ in the Palm OS5
Simulator!  For that, the *only* thing I found that would work is to
keep each batmap resource separate and use the typical BitmapDraw
function that gets the resource, locks it, draws with it in the
appropriate window, and unlocks it again.  Nothing else there seemed to
respect the transparency, which means that we'll end up with double the
amount of graphics unless the simulator is broken.

-Ken











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

Reply via email to