Board index » delphi » Transparent TextOut for Tcanvas ?

Transparent TextOut for Tcanvas ?

I try to get text on a Tcanvas without the brush background color (i.e.
transparent). But I can't find the way to do it. Anybody knows how to ?

The situation is: a pie-chart with different colors. Text to indicate what
the pie-pieces represent. This text sometimes flows across more than one
color.

Kind regards,
TdN

 

Re:Transparent TextOut for Tcanvas ?


On Tue, 15 Oct 2002 11:04:30 +0200, "Tom de Neef" <tden...@qolor.nl>
wrote:

Quote
>I try to get text on a Tcanvas without the brush background color (i.e.
>transparent). But I can't find the way to do it. Anybody knows how to ?

>The situation is: a pie-chart with different colors. Text to indicate what
>the pie-pieces represent. This text sometimes flows across more than one
>color.

Canvas.Brush.Style := bsClear;
Canvas.TextOut(...)

--
jc

Re:Transparent TextOut for Tcanvas ?


Out of interest ... what does
   Canvas.TextFlags    ETO_OPAQUE
actually do

The Help is ... well rather opaque

On Tue, 15 Oct 2002 11:28:34 +0100, Jeremy Collins

Quote
<jd.coll...@ntlworld.com> wrote:
>On Tue, 15 Oct 2002 11:04:30 +0200, "Tom de Neef" <tden...@qolor.nl>
>wrote:

>>I try to get text on a Tcanvas without the brush background color (i.e.
>>transparent). But I can't find the way to do it. Anybody knows how to ?

>>The situation is: a pie-chart with different colors. Text to indicate what
>>the pie-pieces represent. This text sometimes flows across more than one
>>color.

>Canvas.Brush.Style := bsClear;
>Canvas.TextOut(...)

>--
>jc

Re:Transparent TextOut for Tcanvas ?


On Tue, 15 Oct 2002 10:49:48 GMT, Bounce_It_je...@iss.u-net.com_.bin

Quote
(J French) wrote:
>Out of interest ... what does
>   Canvas.TextFlags    ETO_OPAQUE
>actually do

>The Help is ... well rather opaque

I don't think I've ever needed to use TextFlags (I usually find
DrawText() more useful), but from the MSDN library:

"ETO_OPAQUE
An Extended Text Out constant that specifies that the current
background color fills the rectangle. "

A shorter, and better explanation than the Delphi help entry!

--
jc

Re:Transparent TextOut for Tcanvas ?


Thanks
- I see that Delphi uses ExtTextOut() under the hood
- but it seems to have little effect

On Tue, 15 Oct 2002 13:25:37 +0100, Jeremy Collins

Quote
<jd.coll...@ntlworld.com> wrote:
>On Tue, 15 Oct 2002 10:49:48 GMT, Bounce_It_je...@iss.u-net.com_.bin
>(J French) wrote:

>>Out of interest ... what does
>>   Canvas.TextFlags    ETO_OPAQUE
>>actually do

>>The Help is ... well rather opaque

>I don't think I've ever needed to use TextFlags (I usually find
>DrawText() more useful), but from the MSDN library:

>"ETO_OPAQUE
>An Extended Text Out constant that specifies that the current
>background color fills the rectangle. "

>A shorter, and better explanation than the Delphi help entry!

>--
>jc

Other Threads