X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fa378d369f620debdfe719cb4c1a1c577137fb26..8a31648287be0ef976f133de2786b137f1e98340:/src/msw/graphics.cpp diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index e2065c05e9..e5161c5d5b 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -541,6 +541,7 @@ public : virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ); #if wxUSE_IMAGE virtual wxGraphicsBitmap CreateBitmapFromImage(const wxImage& image); + virtual wxImage CreateImageFromBitmap(const wxGraphicsBitmap& bmp); #endif // wxUSE_IMAGE virtual wxGraphicsFont CreateFont( const wxFont& font, @@ -898,7 +899,7 @@ wxGDIPlusFontData::Init(const wxString& name, const wxColour& col, Unit fontUnit) { - m_font = new Font(name, size, style, fontUnit); + m_font = new Font(name.wc_str(), size, style, fontUnit); m_textBrush = new SolidBrush(wxColourToColor(col)); } @@ -1078,22 +1079,6 @@ wxGDIPlusBitmapData::~wxGDIPlusBitmapData() delete m_helper; } -// ---------------------------------------------------------------------------- -// wxGraphicsBitmap implementation -// ---------------------------------------------------------------------------- - -#if wxUSE_IMAGE - -wxImage wxGraphicsBitmap::ConvertToImage() const -{ - const wxGDIPlusBitmapData* const - data = static_cast(GetGraphicsData()); - - return data ? data->ConvertToImage() : wxNullImage; -} - -#endif // wxUSE_IMAGE - //----------------------------------------------------------------------------- // wxGDIPlusPath implementation //----------------------------------------------------------------------------- @@ -2194,8 +2179,19 @@ wxGraphicsBitmap wxGDIPlusRenderer::CreateBitmapFromImage(const wxImage& image) return wxNullGraphicsBitmap; } + +wxImage wxGDIPlusRenderer::CreateImageFromBitmap(const wxGraphicsBitmap& bmp) +{ + ENSURE_LOADED_OR_RETURN(wxNullImage); + const wxGDIPlusBitmapData* const + data = static_cast(bmp.GetGraphicsData()); + + return data ? data->ConvertToImage() : wxNullImage; +} + #endif // wxUSE_IMAGE + wxGraphicsBitmap wxGDIPlusRenderer::CreateBitmapFromNativeBitmap( void *bitmap ) { ENSURE_LOADED_OR_RETURN(wxNullGraphicsBitmap);