nanogui: How to draw image with transparency over another image ?


Previous by date: 30 Nov 2007 17:13:24 +0000 Re: Can not find fonts., Greg Haerr
Next by date: 30 Nov 2007 17:13:24 +0000 Re: Can not find fonts., David Siebert
Previous in thread: 30 Nov 2007 17:13:24 +0000 How to draw image with transparency over another image ?, Vladimir
Next in thread:

Subject: Re: [nanogui] How to draw image with transparency over another image ?
From: "Greg Haerr" ####@####.####
Date: 30 Nov 2007 17:13:24 +0000
Message-Id: <12bf01c83374$52c4a0e0$0300a8c0@RDP>

: And the question is - how to draw the PNG image over the window ?
: I mean that if the battery state is changed that I should draw another
: image on the same position, but of course the background will not
: repaint by itself.

There's a function GrClearWindow, which could force
the root window to redisplay the picture...  but I'm
not sure that's a good idea here, since the implementation
of this function would like cause the entire picture to
be re-displayed, clipped to your small battery display
area, which would waste tons of CPU time.

If your battery area was in fact a window, with no background
or border, then unmapping the window would have the same 
effect.  If the battery were a background image on that
window, it might be drawn with transparency and the whole
thing handled by unmap/map of the battery window... ?
I'm not sure whether we correctly handle transparency with
background pixmaps...

: Or I should save the image behind the battery indicator to some
: offscreen pixmap and after each change of its state I should restore
: the background and then draw the battery image ?

That's probably a pretty good idea. I'm not sure how to handle
the problem of when the root window image changes though. 
You'd likely have to select for root window UPDATE events.

Regards,

Greg


Previous by date: 30 Nov 2007 17:13:24 +0000 Re: Can not find fonts., Greg Haerr
Next by date: 30 Nov 2007 17:13:24 +0000 Re: Can not find fonts., David Siebert
Previous in thread: 30 Nov 2007 17:13:24 +0000 How to draw image with transparency over another image ?, Vladimir
Next in thread:


Powered by ezmlm-browse 0.20.