Re: Delphi Question: about drawing text on a TImage

Posted by Jonathan on January 15, 2006

In Reply to: Delphi Question: about drawing text on a TImage posted by Fredrik N on December 23, 2005

: I have a problem in a program i am making. I need to Draw text on a TImage object with a picture in the background, but i want the text background to be transperent.

: When I use the TextOut procedure, I get a solid color background behind the text. Anyne who knows how to do it?

To let the background of a text on a Delphi Canvas show through the text (no "solid" background), you have to set the style of the canvas Brush to bsClear. Source code:

with Image1.Canvas do begin
  Brush.Style := bsClear;
  TextOut(10, 10, 'Background still visible'); 
end;