MGR: If CSkinIcon PNG file has an alpha channel, use it as mask and ignore any <transparency_mask> tag

svn path=/trunk/boinc/; revision=24779
This commit is contained in:
Charlie Fenton 2011-12-13 00:27:42 +00:00
parent 20ec2b2ac4
commit 6698ccee24
2 changed files with 11 additions and 2 deletions

View File

@ -9006,3 +9006,10 @@ Rom 12 Dec 2011
win_build/installerv2/redist/Windows/x64/
boinccas.dll
boinccas95.dll
Charlie 7 Dec 2011
- MGR: If CSkinIcon PNG file has an alpha channel, use it as mask and
ignore any <transparency_mask> tag.
clientgui/
SkinManager.cpp

View File

@ -238,8 +238,10 @@ bool CSkinIcon::Validate() {
if (!m_icoIcon.Ok()) {
if (!m_strDesiredIcon.IsEmpty()) {
// Configure bitmap object with optional transparency mask
wxBitmap bmp = wxBitmap(wxImage(m_strDesiredIcon, wxBITMAP_TYPE_ANY));
if (!m_strDesiredTransparencyMask.IsEmpty()) {
wxImage img = wxImage(m_strDesiredIcon, wxBITMAP_TYPE_ANY);
wxBitmap bmp = wxBitmap(img);
// If PNG file has alpha channel use it as mask & ignore <transparency_mask> tag
if (!(m_strDesiredTransparencyMask.IsEmpty() || img.HasAlpha())) {
bmp.SetMask(new wxMask(bmp, ParseColor(m_strDesiredTransparencyMask)));
}
// Now set the icon object using the newly created bitmap with optional transparency mask