nanogui: Thread: Setting background as transparent


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Setting background as transparent
From: "pratish ganguly" ####@####.####
Date: 27 Sep 2006 14:22:04 +0100
Message-Id: <fa595afb0609270621y3bc42f41pdd0cb0a7639cb3fb@mail.gmail.com>

Dear all,

I am trying to write a string on top of an image using the API GrText(), but
the text is printed on a black background.
I tried searching on the net for the flags that can be used in the
GrSetFontAttr() as well as GrText() APIs for transparent background, but
couldn't fix the problem.
Am I missing something here ?
Please suggest me some pointers so that I can set the background as
transparent.

Thanks and regard.

Pratish Ganguly
Subject: Re: [nanogui] Setting background as transparent
From: ####@####.#### ####@####.####
Date: 28 Sep 2006 03:04:14 +0100
Message-Id: <1159409061.2675.2.camel@fc5>

On Wed, 2006-09-27 at 18:51 +0530, pratish ganguly wrote:
> Dear all,
> 
> I am trying to write a string on top of an image using the API GrText(), but
> the text is printed on a black background.
> I tried searching on the net for the flags that can be used in the
> GrSetFontAttr() as well as GrText() APIs for transparent background, but
> couldn't fix the problem.
> Am I missing something here ?
> Please suggest me some pointers so that I can set the background as
> transparent.
> 
> Thanks and regard.
> 
> Pratish Ganguly

That's easy, just try to set you GC like this,
	GrSetGCUseBackground(gc, GR_FALSE); 
	GrText(w, gc, 10, 30, "hey, don't touch me!!", -1, GR_TFASCII); 

Alex

Subject: Re: [nanogui] Setting background as transparent
From: "pratish ganguly" ####@####.####
Date: 28 Sep 2006 04:16:12 +0100
Message-Id: <fa595afb0609272016w3210391cw44a600c905176b17@mail.gmail.com>

Thank you all for helping me out.
This really solved my problem.
I am now able to print text with transparent background in my application.

Thanks and regards.

Pratish Ganguly

On 9/28/06, ####@####.#### ####@####.#### wrote:
>
> On Wed, 2006-09-27 at 18:51 +0530, pratish ganguly wrote:
> > Dear all,
> >
> > I am trying to write a string on top of an image using the API GrText(),
> but
> > the text is printed on a black background.
> > I tried searching on the net for the flags that can be used in the
> > GrSetFontAttr() as well as GrText() APIs for transparent background, but
> > couldn't fix the problem.
> > Am I missing something here ?
> > Please suggest me some pointers so that I can set the background as
> > transparent.
> >
> > Thanks and regard.
> >
> > Pratish Ganguly


 Try
>

> GrSetGCUseBackground(gc, GR_FALSE);
>
> Before writing your text. This causes the text background to be
> "transparent" as it does it paint the background color.
>
> Remember to
>
> GrSetGCUseBackground(gc, GR_TRUE);
>
> Before writing text with the set background color.
>
>
> tj
>
>
That's easy, just try to set you GC like this,
>         GrSetGCUseBackground(gc, GR_FALSE);
>         GrText(w, gc, 10, 30, "hey, don't touch me!!", -1, GR_TFASCII);
>
> Alex
>
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.