Board index » delphi » Writing transparent text to a canvas ...

Writing transparent text to a canvas ...

Does anyone know if it is possible to write transparent text to a
bitmap?

I need to have a picture loaded on the canvas, and then be able to write
text on top of it without getting a square around each letter.

I have already tried using Transparent mode, copying the text from a
temporary bitmap to the one with the picture. It treats the general
background as transparent, but still insists on drawing the box around
the text.

Any help will be much appreciated.

Bryan d'Art
Head of Software Development
Lancom Technologies (Australia)

 

Re:Writing transparent text to a canvas ...


Bryan,
  Try setting the Brush.Style property of the canvas to bsClear and use the
TextOut procedure to send the desired text to the canvas.  I.e.:

  Image1.Canvas.Brush.Style := bsClear;
  Image1.Canvas.TextOut(150, 100, 'Test text!');

if your doing this on a form then you could also use the TLabel component
and set the Transparent property to True.  This would probably be more
useful if you wanted to cahnge the text while the program is running.

Hope this helps!
--

Rodney E Geraghty
GERA-Tech
Ottawa, Canada
gera...@ibm.net

Bryan d'Art <psionic...@hotmail.com> wrote in article
<3470EDC7.96CCC...@hotmail.com>...

Quote
> Does anyone know if it is possible to write transparent text to a
> bitmap?

> I need to have a picture loaded on the canvas, and then be able to write
> text on top of it without getting a square around each letter.

> I have already tried using Transparent mode, copying the text from a
> temporary bitmap to the one with the picture. It treats the general
> background as transparent, but still insists on drawing the box around
> the text.

> Any help will be much appreciated.

> Bryan d'Art
> Head of Software Development
> Lancom Technologies (Australia)

Other Threads