Added wxGraphicsBitmap::ConvertToImage().
Allow to convert wxGraphicsBitmap directly to wxImage, without passing by wxBitmap. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69353 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -978,6 +978,14 @@ public:
|
||||
|
||||
virtual CGImageRef GetBitmap() { return m_bitmap; }
|
||||
bool IsMonochrome() { return m_monochrome; }
|
||||
|
||||
#if wxUSE_IMAGE
|
||||
wxImage ConvertToImage() const
|
||||
{
|
||||
return wxBitmap(m_bitmap).ConvertToImage();
|
||||
}
|
||||
#endif // wxUSE_IMAGE
|
||||
|
||||
private :
|
||||
CGImageRef m_bitmap;
|
||||
bool m_monochrome;
|
||||
@@ -993,6 +1001,18 @@ wxMacCoreGraphicsBitmapData::~wxMacCoreGraphicsBitmapData()
|
||||
CGImageRelease( m_bitmap );
|
||||
}
|
||||
|
||||
#if wxUSE_IMAGE
|
||||
|
||||
wxImage wxGraphicsBitmap::ConvertToImage() const
|
||||
{
|
||||
wxMacCoreGraphicsBitmapData* const
|
||||
data = static_cast<wxMacCoreGraphicsBitmapData*>(GetRefData());
|
||||
|
||||
return data ? data->ConvertToImage() : wxNullImage;
|
||||
}
|
||||
|
||||
#endif // wxUSE_IMAGE
|
||||
|
||||
//
|
||||
// Graphics Matrix
|
||||
//
|
||||
|
Reference in New Issue
Block a user