SftButton/OCX 2.5

Bitmap Transparency

Softel vdm, Inc.

SftButton/OCX automatically uses bitmap transparency for all bitmaps used throughout a control. When a bitmap is displayed, the background can show through portions of the bitmap. SftButton/OCX accomplishes this by dynamically modifying a copy of the bitmap to adjust for the background color. While icons and Windows metafiles are also supported by SftButton/OCX, these file formats already define transparency, based on how the image was created. These file formats receive no special processing by SftButton/OCX.

The top, left pixel of each bitmap is inspected as the bitmap is painted. The color of that pixel represents the bitmap's background color. This color is replaced throughout the bitmap with the actual background color.

If the bitmap image includes the top, left pixel, add an extra row or column of pixels to the bitmap, so the image does not include the top, left pixel.

Bitmap transparency is only used for bitmaps and is not used for icons, images in an ImageList control, Windows metafiles, GDI+ images (e.g, NETImageObject property) or other images that can be represented by a SftPictureObject object.

.NET  When using SftButton/OCX with .NET, bitmap transparency is only used for bitmaps loaded using the property pages. Any bitmaps converted from a PictureBox or an Image object will not use bitmap transparency.  With .NET, the PictureBox control and Image objects support all image formats (gif, jpeg, ico, etc.) and are also supported by SftButton/OCX.  Some of these image formats already define transparency and should be used if image transparency is desired.

Bitmap transparency is fully automatic (for images based on bitmaps) and cannot be turned off. Icons, animations and Windows metafiles are not affected by bitmap transparency.


Feedback / comments / error reports for this topic
© 2008 - Softel vdm, Inc. - www.softelvdm.com