Alpha Bug in GUIThumbnailPanel? (1 Viewer)

Kurtis

Portal Member
April 17, 2007
11
2
49
Home Country
United States of America United States of America
So, in RenderItem in GUIThumbnailPanel the following code:

Code:
      long dwColor = _textColor;
      if (pItem.Selected) dwColor = _selectedColor;
      if (pItem.IsPlayed) dwColor = _playedColor;
      if (!bFocus && Focus) dwColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb();

seems to set the color for the text to be drawn under the thumbnail. The problem is that the way it is currently written, unfocusedAlpha completely overwrites the alpha channel of the text color, where what I think is probably intended in a blend. If (for instance) somebody wanted to make the text completely transparent, they would have to also set unfocusedAlpha to 0x00, which would result in the entire non-focused item becoming transparent, right?

The fix, I think, is to scale the alpha channel in question, something like:

Code:
     long dwColor = _textColor;
      if (pItem.Selected) dwColor = _selectedColor;
      if (pItem.IsPlayed) dwColor = _playedColor;
      if (!bFocus && Focus)
      {
          Color c = Color.FromArgb((int)dwColor);
          dwColor = Color.FromArgb(c.A * _unfocusedAlpha, c.R, c.G, c.B).ToArgb();
      }

That lets me set my text to transparent if I want, though it now requires an integer multiplication.
 

Users who are viewing this thread


Write your reply...
Top Bottom