X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fa378d369f620debdfe719cb4c1a1c577137fb26..37fff49cf1fa0306ba13d9ccc235c0c1c0ae3b62:/include/wx/graphics.h diff --git a/include/wx/graphics.h b/include/wx/graphics.h index dc17baf075..d385d7db02 100644 --- a/include/wx/graphics.h +++ b/include/wx/graphics.h @@ -842,6 +842,7 @@ public: virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) = 0; #if wxUSE_IMAGE virtual wxGraphicsBitmap CreateBitmapFromImage(const wxImage& image) = 0; + virtual wxImage CreateImageFromBitmap(const wxGraphicsBitmap& bmp) = 0; #endif // wxUSE_IMAGE // create a graphics bitmap from a native bitmap @@ -855,6 +856,16 @@ private: DECLARE_ABSTRACT_CLASS(wxGraphicsRenderer) }; -#endif + +#if wxUSE_IMAGE +inline +wxImage wxGraphicsBitmap::ConvertToImage() const +{ + wxGraphicsRenderer* renderer = GetRenderer(); + return renderer ? renderer->CreateImageFromBitmap(*this) : wxNullImage; +} +#endif // wxUSE_IMAGE + +#endif // wxUSE_GRAPHICS_CONTEXT #endif // _WX_GRAPHICS_H_