Implemented wxBitmap::HasAlpha() and ::UseAlpha().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32086 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2005-02-15 20:27:46 +00:00
parent a4ea2d8dbb
commit 0ff2a74d0c
5 changed files with 41 additions and 6 deletions

View File

@ -3,7 +3,7 @@
%\overview{Overview}{wxbitmapoverview}
%
This class encapsulates the concept of a platform-dependent bitmap,
either monochrome or colour.
either monochrome or colour or colour with alpha channel support.
\wxheading{Derived from}
@ -72,7 +72,8 @@ bitmaps from static data.
Creates a new bitmap. A depth of -1 indicates the depth of the current screen
or visual. Some platforms only support 1 for monochrome and -1 for the current
colour setting.
colour setting. Beginning with version 2.5.4 of wxWidgets a depth if 32 including
an alpha channel is supported under MSW, Mac and GTK+.
\func{}{wxBitmap}{\param{const char**}{ bits}}

View File

@ -137,8 +137,8 @@ public:
void *GetRawData(wxPixelDataBase& data, int bpp);
void UngetRawData(wxPixelDataBase& data);
bool HasAlpha() const { return true; }
void UseAlpha() { }
bool HasAlpha() const;
void UseAlpha();
protected:
bool CreateFromXpm(const char **bits);

View File

@ -137,8 +137,8 @@ public:
void *GetRawData(wxPixelDataBase& data, int bpp);
void UngetRawData(wxPixelDataBase& data);
bool HasAlpha() const { return true; }
void UseAlpha() { }
bool HasAlpha() const;
void UseAlpha();
protected:
bool CreateFromXpm(const char **bits);

View File

@ -1597,6 +1597,23 @@ void wxBitmap::UngetRawData(wxPixelDataBase& data)
{
}
bool wxBitmap::HasAlpha() const
{
#ifdef __WXGTK20__
return HasPixbuf();
#else
return false;
#endif
}
void wxBitmap::UseAlpha()
{
#ifdef __WXGTK20__
GetPixbuf();
#endif
}
//-----------------------------------------------------------------------------
// wxBitmapHandler
//-----------------------------------------------------------------------------

View File

@ -1597,6 +1597,23 @@ void wxBitmap::UngetRawData(wxPixelDataBase& data)
{
}
bool wxBitmap::HasAlpha() const
{
#ifdef __WXGTK20__
return HasPixbuf();
#else
return false;
#endif
}
void wxBitmap::UseAlpha()
{
#ifdef __WXGTK20__
GetPixbuf();
#endif
}
//-----------------------------------------------------------------------------
// wxBitmapHandler
//-----------------------------------------------------------------------------