Inside Man
Inside Man

Reputation: 4319

Remove Transparency From Glyph.Data in SpeedButtons

I have an old app (Delphi 5) which I want to give it some changes.

I have set a Glyph.Data for a speedbutton, but some colors are transparent and in some places I see small white dots on my image, I do not want to set transparency for the image, How to remove it (transparency)?

Any help is really appreciated. Thanks :)

Upvotes: 0

Views: 1624

Answers (3)

Inside Man
Inside Man

Reputation: 4319

I have found the answer, Delphi thinks the transparent color is the color of most left - bottom pixel of this image. So If I set a color which is not used in my image in the most left-bottom of my image, then Delphi only will make that small pixel transparent and other parts of my image will be OK without transparency, So this post is completed by myself :))

Upvotes: 0

Duilio Juan Isola
Duilio Juan Isola

Reputation: 237

The transparency is a color that is not drawn. You just have to change the image or set another color as the transparent one.

From Delphi 6 Help

Transparent color

Use the Transparent color drop-down to specify which color is used to create a mask for drawing the image transparently. The default transparent color is the color of the bitmap's left-most pixel in the bottom line. You can also change the transparent color by clicking directly on a pixel in the selected image.

When an image has a transparent color, any pixels in the image of that color are not rendered in that color, but instead appear transparent, allowing whatever is behind the image to show through.

If the image is an icon, Transparent color appears grayed and the transparent color is set to clNone. This is because icons are already masked.

enter image description here

Upvotes: 1

Lars Truijens
Lars Truijens

Reputation: 43645

Set TSpeedButton.Transparent to False.

Upvotes: 1

Related Questions