nanogui: How to write text through an ico?


Previous by date: 17 Oct 2005 04:39:33 +0100 Re: basic lifecycle question - nano-X, Greg Haerr
Next by date: 17 Oct 2005 04:39:33 +0100 [PATCH] fix crash in rtems keyboard driver and prepare rtems mw uid drivers for usage in ecos, Alexander Neundorf
Previous in thread: 17 Oct 2005 04:39:33 +0100 Re: How to write text through an ico?, Greg Haerr
Next in thread:

Subject: Re: [nanogui] How to write text through an ico?
From: tj ####@####.####
Date: 17 Oct 2005 04:39:33 +0100
Message-Id: <43531D46.9070301@comcast.net>

Greg Haerr wrote:

>: Ok I think heh, use SetWindowBackgroundColor(wid, WHITE), write and draw 
>: to it using xor as needed, and then SetWindowBackgroundColor(wid, 
>: BACKGROUND_COLOR). Well that kinda worked. But, it seemed that 
>: SetWindowBackgroundColor() generates an exposure event when you change 
>: it to a different color. So I ended up with continuous exposure events.
>
>Don't use SetWindowBackgroundColor, just FillRect the back
>ground to a color, then XOR draw on it.
>
>  
>
XOR won't work because of the background color not being white. As I 
stated if I draw the background and then the icon, the inon is black, 
and then set mode xor and write the text as black. But, while the text 
over the black turns white, the xor, the text over the non-white 
background is some shade of grey, not black. If you reverse the process, 
draw the text and xor the black icon, then the inon is some shade of 
grey from xor'ing with the non-black background.

My whole objective is to have black text over the background while the 
text is white when over the black incon.

That was whole point of trying to load the icon image gif file, with 
transparent background, into a pixmap. Then write xor'ing the text in 
the pixmap and copying the pixmap to the window  with the transparentcy 
allowing the window's background color to show through, but having no 
effect on the resulting text and icon colors. But, as you stated, 
pixmaps do not support transparency. and I m trying some other way to 
make this work.

>: 
>: I then tried creating a "phantom window" that had no exposure bit set, 
>: doing like I mentioned above and GrCopyArea() to the real window from 
>: the phantom window. But, it did not work. Can't you copy from one window 
>: to another?
>
>GrCopyArea will work between pixmaps, or windows that are mapped
>on the screen.  That is, GrCopyArea only copies real bits (either stored
>bits for pixmaps, or actually displayed (not overlapped) bits in windows.
>
>Regards,
>
>Greg
>
>  
>
tj


Previous by date: 17 Oct 2005 04:39:33 +0100 Re: basic lifecycle question - nano-X, Greg Haerr
Next by date: 17 Oct 2005 04:39:33 +0100 [PATCH] fix crash in rtems keyboard driver and prepare rtems mw uid drivers for usage in ecos, Alexander Neundorf
Previous in thread: 17 Oct 2005 04:39:33 +0100 Re: How to write text through an ico?, Greg Haerr
Next in thread:


Powered by ezmlm-browse 0.20.