nanogui: How to write text through an ico?


Previous by date: 16 Oct 2005 23:50:31 +0100 Mouse events, Dave Stuart
Next by date: 16 Oct 2005 23:50:31 +0100 Changing Data, Dave Stuart
Previous in thread:
Next in thread: 16 Oct 2005 23:50:31 +0100 Re: How to write text through an ico?, Greg Haerr

Subject: How to write text through an ico?
From: tj ####@####.####
Date: 16 Oct 2005 23:50:31 +0100
Message-Id: <4352D988.3030007@comcast.net>

I have spent several hours trying to overcome what should be a 
relatively simple problem.


I need to write black text to a window and as it passes through a black 
icon the text color changes to white. It really is no problem, just set 
the mode to GR_MODE_XOR. That is if the window background is white and 
is only white.
The icon is in a gif file with a transparent backgound.

If the background is not white, then if you draw the ico and then xor 
the text, the text is white in the icon, but some shade of grey outside 
the icon depending on the background color.
On the other side if you draw the text and the xor the icon the teext is 
white on the icon, but the icon is some shade of grey and not black.

I have tried drawing to a pixmap first, but the pixmap routines DO NOT 
support transparency (as Greg pointed out a while ago).

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.

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?

Does anybody have an idea on how to solve my problem?

tj


Previous by date: 16 Oct 2005 23:50:31 +0100 Mouse events, Dave Stuart
Next by date: 16 Oct 2005 23:50:31 +0100 Changing Data, Dave Stuart
Previous in thread:
Next in thread: 16 Oct 2005 23:50:31 +0100 Re: How to write text through an ico?, Greg Haerr


Powered by ezmlm-browse 0.20.