added wxBitmap::UseAlpha()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
bc9f356d52
commit
10b41b53cb
@ -146,8 +146,10 @@ public:
|
||||
bool operator==(const wxBitmap& bitmap) const { return m_refData == bitmap.m_refData; }
|
||||
bool operator!=(const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; }
|
||||
|
||||
// this function is internal and shouldn't be used, it risks to disappear
|
||||
// these functions are internal and shouldn't be used, they risk to
|
||||
// disappear in the future
|
||||
bool HasAlpha() const;
|
||||
void UseAlpha();
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_4
|
||||
// these functions do nothing and are only there for backwards
|
||||
|
@ -90,6 +90,9 @@ public:
|
||||
m_bmp.UngetRawData(this);
|
||||
}
|
||||
|
||||
// call this to indicate that we should use the alpha channel
|
||||
void UseAlpha() { m_bmp.UseAlpha(); }
|
||||
|
||||
// accessors
|
||||
unsigned char *GetPixels() const { return m_pixels; }
|
||||
int GetWidth() const { return m_width; }
|
||||
|
@ -267,6 +267,8 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
data.UseAlpha();
|
||||
|
||||
wxRawBitmapIterator p(data);
|
||||
|
||||
p.Offset(BORDER, BORDER);
|
||||
|
@ -1096,6 +1096,12 @@ int wxBitmap::GetQuality() const
|
||||
|
||||
#endif // WXWIN_COMPATIBILITY_2_4
|
||||
|
||||
void wxBitmap::UseAlpha()
|
||||
{
|
||||
if ( GetBitmapData() )
|
||||
GetBitmapData()->m_hasAlpha = true;
|
||||
}
|
||||
|
||||
bool wxBitmap::HasAlpha() const
|
||||
{
|
||||
return GetBitmapData() && GetBitmapData()->m_hasAlpha;
|
||||
|
Loading…
Reference in New Issue
Block a user