nanogui: Thread: text and Fill Rect


[<<] [<] Page 1 of 1 [>] [>>]
Subject: text and Fill Rect
From: Fergal Kelly ####@####.####
Date: 30 May 2002 09:04:47 -0000
Message-Id: <001f01c207b7$8c37ec40$953c78c1@heysen.leop.s3group.com>

Hi,

I'm setting text in a rectangular box but will have to change the colour of
the box from time to time.  Is there any simple means of drawing FillRect
again with a different colour, but without having to redraw the text
string??

Thanks,

Fergal

Subject: Re: [nanogui] text and Fill Rect
From: Alex Holden ####@####.####
Date: 30 May 2002 10:13:09 -0000
Message-Id: <3CF5F8CC.9050100@linuxhacker.org>

Fergal Kelly wrote:
> Hi,
> 
> I'm setting text in a rectangular box but will have to change the colour of
> the box from time to time.  Is there any simple means of drawing FillRect
> again with a different colour, but without having to redraw the text
> string??

Are you talking about the background of the box or a border around the 
box? If the former, then you have to redraw the text because the 
FillRect will paint over the old text. Also you will need to change the 
background colour of your GC so that the new text is drawn with the new 
background colour. If it's a border around the box, then you can easily 
draw the border with four rectangles without touching the text in the 
middle.

PS. is there any way to tell your mail client to use a real character 
set instead of "x-user-defined"? It really confuses Mozilla mail.

-- 
------------ Alex Holden - http://www.linuxhacker.org ------------
If it doesn't work, you're not hitting it with a big enough hammer

Subject: Re: [nanogui] text and Fill Rect
From: Fergal Kelly ####@####.####
Date: 30 May 2002 10:22:56 -0000
Message-Id: <001901c207c2$78fde430$953c78c1@heysen.leop.s3group.com>

Hi,

I suspected as much, I have to use Fill Rect because I need to have the complete background a different colour.  It's not a problem, just it would have been really neat if somehow the rect could filled beneath the text, so too speak.

Thanks,

Fergal
-----Original Message-----
From: Alex Holden ####@####.####
To: Fergal Kelly ####@####.####
Cc: ####@####.#### ####@####.####
Date: 30 May 2002 11:03
Subject: Re: [nanogui] text and Fill Rect


|Fergal Kelly wrote:
|> Hi,
|> 
|> I'm setting text in a rectangular box but will have to change the colour of
|> the box from time to time.  Is there any simple means of drawing FillRect
|> again with a different colour, but without having to redraw the text
|> string??
|
|Are you talking about the background of the box or a border around the 
|box? If the former, then you have to redraw the text because the 
|FillRect will paint over the old text. Also you will need to change the 
|background colour of your GC so that the new text is drawn with the new 
|background colour. If it's a border around the box, then you can easily 
|draw the border with four rectangles without touching the text in the 
|middle.
|
|PS. is there any way to tell your mail client to use a real character 
|set instead of "x-user-defined"? It really confuses Mozilla mail.
|
|-- 
|------------ Alex Holden - http://www.linuxhacker.org ------------
|If it doesn't work, you're not hitting it with a big enough hammer
|
Subject: Re: text and Fill Rect
From: "Aaron J. Grier" ####@####.####
Date: 30 May 2002 17:18:39 -0000
Message-Id: <20020530100752.J12218@aaron.internal>

On Thu, May 30, 2002 at 11:12:14AM +0100, Fergal Kelly wrote:
> I suspected as much, I have to use Fill Rect because I need to have
> the complete background a different colour.  It's not a problem, just
> it would have been really neat if somehow the rect could filled
> beneath the text, so too speak.

if you have palettized colors, you could use a unique palette entry for
the text background, then change the palette entry.

or create an analogue to fill rect which changes one color to another
without disturbing "third party" colors.

-- 
  Aaron J. Grier  |   Frye Electronics, Tigard, OR   |  ####@####.####
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.