|
|
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Images for disabled button in "Classic" style
|
|
|
Re: Images for disabled button in "Classic" style [message #26107 is a reply to message #26105] |
Thu, 01 April 2010 14:54 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
Yes, it is a transparency issue. This is the filter being used for DisabledImage with XP classic:
RGBA sEtchFilter::operator()(const RGBA **mx)
{
RGBA t;
RGBA s = mx[1][1];
if(s.a == 255 && s.r + s.g + s.b < 400) {
t.r = t.g = t.b = 128;
t.a = 255;
return t;
}
s = mx[0][0];
if(s.a == 255 && s.r + s.g + s.b < 400) {
t.r = t.g = t.b = t.a = 255;
return t;
}
Zero(t);
return t;
} ImageOp.cpp
The alpha limit is there because you don't want to etch invisible pixels, it would look wierd.
IMO a good compromise would be this version that checks for alpha > 128:
RGBA sEtchFilter::operator()(const RGBA **mx)
{
RGBA t;
RGBA s = mx[1][1];
if(s.a & 0x80 && s.r + s.g + s.b < 400) {
t.r = t.g = t.b = 128;
t.a = s.a;
return t;
}
s = mx[0][0];
if(s.a & 0x80 && s.r + s.g + s.b < 400) {
t.r = t.g = t.b = 255;
t.a = s.a;
return t;
}
Zero(t);
return t;
}
[Updated on: Thu, 01 April 2010 15:13] Report message to a moderator
|
|
|
Re: Images for disabled button in "Classic" style [message #26112 is a reply to message #26107] |
Thu, 01 April 2010 18:28 |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |
|
|
Tested your patch with some semi-transparent images.
All of them look good enough, also (s.a & 0x80) is a quick enough comparison.
Finally I agree with your proposal. Can you please publish it on SVN? Or else we should ask Mirek.
P.S. Why don't you use the same "transparency" method for classic theme disabled image?
[Updated on: Thu, 01 April 2010 18:32] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Mon May 06 05:47:14 CEST 2024
Total time taken to generate the page: 0.01511 seconds
|
|
|