Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
mrjt is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ButtonOption bug? Centering QTF string
Next Topic: WhenSelected callback to DropList
Goto Forum:
  


Current Time: Mon May 06 05:00:36 CEST 2024

Total time taken to generate the page: 0.02449 seconds