Board index » delphi » How to write text with transparent background on a canvas with TextOut()

How to write text with transparent background on a canvas with TextOut()

Hi

I have written a little program that I can use to label my pictures with but
whenever I use the Canvas.TextOut(x,y,string) method, the background of the
text is white. I was looking at the TextFlags property of the canvas and
there seems to only be the option:

ETO_OPAQUE           The text is drawn with an opaque background
                                    Color. Using this flag improves
performance but
                                    does not allow images behind the text
rectangle to show.

Which is exactly what it is ALREADY doing :( Is there a way to write with a
transparent background of the text so the image in the background is still
shown?

Thanx.

 

Re:How to write text with transparent background on a canvas with TextOut()


Ok wait.. I worked it out *feels really stupid*..

I tried everything I could think of before writing that message but then I
thought about "how does the TextOut thingy work".. using the TPen, TFont
and... TBrush.. :)

So I tried changing the Brush.Style property to bsClear and it worked!! :)
lol.. oh well.. :)

Other Threads