Board index » cppbuilder » TForm with tiled bitmap background

TForm with tiled bitmap background

I have a bitmap tiled onto my form (using ZieglerSoft's background
component). I can place labels on the form using TLabel's Transparent
property, and have the label text appear directly over the tiled image
background. So far, so good.

 But how do I achieve transparency when I use TextOut, which doesn't seem to
have a "Transparent" property? And I have the same problem with a
TScrollBox/TPaintBox. Can't find a way to let my form's bitmap background be
used instead of the "Color" property of the TScrollBox/TPaintBox.  Any help
very much appreciated. Thanks.

-Lew Barnesson

 

Re:TForm with tiled bitmap background


Quote
"Lew Barnesson" <lewb...@msn.com> wrote in message

news:935rjh$8do6@bornews.inprise.com...

Quote
>  But how do I achieve transparency when I use TextOut, which doesn't seem
to
> have a "Transparent" property?

See what happens if you set the Canvas->Font->Brush->Style = bsClear first

Otherwise, you're going to have to use the Win32 API's SetBkMode() and
TextOut() functions directly instead

Quote
> And I have the same problem with a TScrollBox/TPaintBox. Can't find a way
to
> let my form's bitmap background be used instead of the "Color" property of
the
> TScrollBox/TPaintBox.  Any help very much appreciated. Thanks.

Same here.  TScrollBox has a Brush property (not a Canvas->Brush) that you
can set it's Style = bsClear.  And with TPaintBox, use it's Canvas->Brush.

Gambit

Re:TForm with tiled bitmap background


Remy,
"Canvas->Brush->Style = bsClear" worked like a charm for TextOut. Thanks
again.

But still no success on getting the background to show through on a
TPaintBox parented by a TScrollBox, which is in turn parented by a form. I
always get a white background. The operation goes like this:
  TScrollBox *pSB;
  TPaintBox * pPB;
 ...
  pSB->Brush->Style = bsClear;                        //No canvas, but has a
Brush
    and
  pPB->Canvas->Brush->Style = bsClear;      //Has canvas

Later, when I change Brush->Color to draw shapes on the paintbox, I make
sure that
I immediately reset the color to clNone (which I started it with).

But no backround image appears. Any more ideas? Grateful for help.

-Lew

Other Threads