PDA

View Full Version : How do you set a transparent background for a .bmp file?



Nils G. Svedmyr
1-Oct-2009, 06:58 AM
Hi,

For the cImageContainer class, how do you set the background transparency for bitmap files?

For all other image formats it works great, but I cannot get it to work for bitmaps. What am I missing? It doesn't matter if pbLoadFromResource is set to True or False, same result.

TIA.

Javier
27-Oct-2009, 02:53 PM
Nils:

While the things have not changed, the BMP format can't support the transparent color like other formats.

The BMP converts all colors to a 256 colors palette. ( Old limitations ).

You can view it with 2D software.
If you use the "chessboard" to show the transparent zone, you save in BMP, close, and open the file, the "chessboard" is replaced by a solid color.


Javier

Nils G. Svedmyr
28-Oct-2009, 03:01 AM
Hi Javier,

Yes you are right, but these were bitmap files with the correct color depths and works just fine with the standard BitmapContainer class.