Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: 32bit TBitBtn glyphs look great with VCL Styles, ugly in "Windows" theme.


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Mar 29, 2016 11:03 AM Last Post By: Remy Lebeau (Te...
Carl Olsen

Posts: 124
Registered: 3/29/00
32bit TBitBtn glyphs look great with VCL Styles, ugly in "Windows" theme.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 29, 2016 10:11 AM
I have a form with a TBitBtn on it. I assign this button a 32 bit with alpha channel .BMP.

If I do this:

 TStyleManager.TrySetStyle('Windows');  // Assign default Windows theme (no theme)


...then the alpha blending is not there, and the edges look all chunky and ugly.

If I do this:

 TStyleManager.TrySetStyle('Auric'); // Assign any other vcl Style


...then the alpha blending works perfect, and all is beautiful.

How can I get the alpha blending to work for the default Windows Theme?

I am using Delphi Seattle, if that makes any difference.

Thanks!

Carl.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: 32bit TBitBtn glyphs look great with VCL Styles, ugly in "Windows"theme.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 29, 2016 11:03 AM   in response to: Carl Olsen in response to: Carl Olsen
Carl wrote:

How can I get the alpha blending to work for the default
Windows Theme?

TBitBtn is a standard owner-drawn Windows button. When using the default
theme, the button's glyph drawing does not appear to take alpha into account,
only transparency. If you need alpha, you will have to subclass the button
to handle the CN_DRAWITEM message directly and draw the entire button yourself.
Otherwise, switch to a different button component that supports drawing
glyphs with alpha.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02