Board index » cppbuilder » Graphics::TBitmap TransparentColor doesn't work...

Graphics::TBitmap TransparentColor doesn't work...

Hi all!

Does somebody knows how to set the transparent color of a
loaded bitmap?

I tried this:

Graphics::TBitmap* foreground;

foreground = new Graphics::TBitmap foreground;
foreground->LoadFromFile("Balls.bmp");

foreground->Transparent = true;
foreground->TransparentColor = foreground->Canvas->Pixels[1][1];
foreground->TransparentMode = tmAuto;

I ensured that the first pixel is a pixel which should be
transparent. ( ->Pixels[1][1] )

The problem is that the color I set to transperent are not
transparent at all!

Thanks for patience,

Ingo Weissmann

 

Re:Graphics::TBitmap TransparentColor doesn't work...


Quote
Weismann wrote:
> Hi all!

> Does somebody knows how to set the transparent color of a
> loaded bitmap?

> I tried this:

> Graphics::TBitmap* foreground;

> foreground = new Graphics::TBitmap foreground;
> foreground->LoadFromFile("Balls.bmp");

> foreground->Transparent = true;
> foreground->TransparentColor = foreground->Canvas->Pixels[1][1];
> foreground->TransparentMode = tmAuto;

> I ensured that the first pixel is a pixel which should be
> transparent. ( ->Pixels[1][1] )

> The problem is that the color I set to transperent are not
> transparent at all!

> Thanks for patience,

> Ingo Weissmann

  The first pixel (the left and top most pixel) should be Pixels [0][0].
Is it what you mean with first pixel ???

Other Threads