mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-25 22:21:14 +01:00
Mask for XPM RegisterImage()
Per conversation on http://forum.audacityteam.org/viewtopic.php?f=50&t=96765 I'm not convinced, but the function is unused, so it is a net plus to add this code with a comment.
This commit is contained in:
@@ -448,12 +448,17 @@ wxImage ThemeBase::MaskedImage( char const ** pXpm, char const ** pMask )
|
|||||||
return Img1;
|
return Img1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Legacy function to allow use of an XPM where no theme image was defined.
|
||||||
|
// Bit depth and mask needs review.
|
||||||
|
// Note that XPMs don't offer translucency, so unsuitable for a round shape overlay,
|
||||||
|
// for example.
|
||||||
void ThemeBase::RegisterImage( int &iIndex, char const ** pXpm, const wxString & Name )
|
void ThemeBase::RegisterImage( int &iIndex, char const ** pXpm, const wxString & Name )
|
||||||
{
|
{
|
||||||
|
|
||||||
wxASSERT( iIndex == -1 ); // Don't initialise same bitmap twice!
|
wxASSERT( iIndex == -1 ); // Don't initialise same bitmap twice!
|
||||||
wxBitmap Bmp( pXpm ); // a 24 bit bitmap.
|
wxBitmap Bmp( pXpm );
|
||||||
wxImage Img( Bmp.ConvertToImage() );
|
wxImage Img( Bmp.ConvertToImage() );
|
||||||
|
// The next line recommended by http://forum.audacityteam.org/viewtopic.php?f=50&t=96765
|
||||||
|
Img.SetMaskColour(0xDE, 0xDE, 0xDE);
|
||||||
Img.InitAlpha();
|
Img.InitAlpha();
|
||||||
|
|
||||||
//dmazzoni: the top line does not work on wxGTK
|
//dmazzoni: the top line does not work on wxGTK
|
||||||
|
|||||||
Reference in New Issue
Block a user