nanogui: Drawing transparent bitmaps


Previous by date: 1 Mar 2007 20:07:19 +0000 Simple Application program in Nano-X, Prasanna Kumar K
Next by date: 1 Mar 2007 20:07:19 +0000 Re: Simple Application program in Nano-X, Greg Haerr
Previous in thread: 1 Mar 2007 20:07:19 +0000 Re: Drawing transparent bitmaps, Greg Haerr
Next in thread: 1 Mar 2007 20:07:19 +0000 Re: Drawing transparent bitmaps, Greg Haerr

Subject: Re: [nanogui] Drawing transparent bitmaps
From: Roberto ####@####.####
Date: 1 Mar 2007 20:07:19 +0000
Message-Id: <45E73227.7050006@tnw2000.org>

Hi Uwe,

I had a similar idea like you. My gain was to  have
a transparent color in order to be able to draw an
invisible window with a transparent gif inside.
Intention was to show only the visible part of the gif.

I began in the fb driver like you but found out that the
the clipping of the windows wont work with this mechanism
since several windows may overlap each other.

So I tried to introduce an "alpha map" which is added to each
nanox window. If any drawing routine draws to the window,
the alpha map is filled with the information which pixel
is visible and which not. In the next step I modified the clipping functions
to be able to calculate the visible/invisible pixels if several
windows are overlapping. Greg already mentioned that the
engine doesn't support any additional values to the driver, so
I store this information in a global pointer which can be accessed
by the fb drivers.  I know this is a little bit dirty,
but I had no idea how to solve this in a different way

Anyway, with this modifications I was able to have several transparent gifs
without any rectangular background overlapping each other.
The application simply has to use the GR_ARGB macro to
define the color, where A=0 means transparent and A=255 non-transparent.

You may download what I described above (based on version 0.91)
at ftp.tnw2000.org. But I concentrated in the Nano-X api.
May be it does not work completely with the win32 api.
Contact me if you have problems.

bye

roberto



Previous by date: 1 Mar 2007 20:07:19 +0000 Simple Application program in Nano-X, Prasanna Kumar K
Next by date: 1 Mar 2007 20:07:19 +0000 Re: Simple Application program in Nano-X, Greg Haerr
Previous in thread: 1 Mar 2007 20:07:19 +0000 Re: Drawing transparent bitmaps, Greg Haerr
Next in thread: 1 Mar 2007 20:07:19 +0000 Re: Drawing transparent bitmaps, Greg Haerr


Powered by ezmlm-browse 0.20.