Board index » delphi » TextOut with transparent background

TextOut with transparent background

Is it possible to get the textout-function to render the text without a
background color? I am using delphi 4 and even though canvas.textflags does
_not_ contain ETO_OPAQUE, the text is till rendered with the color of the
paintbox as background! (paintbox.canvas.textflags is in fact 0).

I've figured out a possible workaround using a temporary bitmap, drawing to
it, and then setting the transparentcolor of the bitmap and draw it on to my
canvas, but that is not a... good... solution.

thanx!
/Jacob

 

Re:TextOut with transparent background


Quote
Britt Marie Alsn wrote:
> Is it possible to get the textout-function to render the text without a
> background color? I am using delphi 4 and even though canvas.textflags does
> _not_ contain ETO_OPAQUE, the text is till rendered with the color of the
> paintbox as background! (paintbox.canvas.textflags is in fact 0).

Try to use:
  Canvas.Brush.Style := bsClear;
before text drawing.

Regards,
Michael

Other Threads