GraphicsPath* m_brushPath;
};
-class WXDLLIMPEXP_CORE wxGDIPlusBitmapData : public wxGraphicsObjectRefData
+class WXDLLIMPEXP_CORE wxGDIPlusBitmapData : public wxGraphicsBitmapData
{
public:
wxGDIPlusBitmapData( wxGraphicsRenderer* renderer, Bitmap* bitmap );
~wxGDIPlusBitmapData ();
virtual Bitmap* GetGDIPlusBitmap() { return m_bitmap; }
+ virtual void* GetNativeBitmap() const { return m_bitmap; }
#if wxUSE_IMAGE
wxImage ConvertToImage() const;
void Init(Graphics* graphics, int width, int height);
private:
- virtual void DoDrawText(const wxString& str, wxDouble x, wxDouble y)
- { DoDrawFilledText(str, x, y, wxNullGraphicsBrush); }
- virtual void DoDrawFilledText(const wxString& str, wxDouble x, wxDouble y,
- const wxGraphicsBrush& backgroundBrush);
+ virtual void DoDrawText(const wxString& str, wxDouble x, wxDouble y);
Graphics* m_context;
wxStack<GraphicsState> m_stateStack;
//-----------------------------------------------------------------------------
wxGDIPlusBitmapData::wxGDIPlusBitmapData( wxGraphicsRenderer* renderer, Bitmap* bitmap ) :
- wxGraphicsObjectRefData( renderer ), m_bitmap( bitmap )
+ wxGraphicsBitmapData( renderer ), m_bitmap( bitmap )
{
m_helper = NULL;
}
wxGDIPlusBitmapData::wxGDIPlusBitmapData( wxGraphicsRenderer* renderer,
- const wxBitmap &bmp) : wxGraphicsObjectRefData( renderer )
+ const wxBitmap &bmp) : wxGraphicsBitmapData( renderer )
{
m_bitmap = NULL;
m_helper = NULL;
if (m_interpolation == interpolation)
return true;
- m_interpolation = interpolation;
-
InterpolationMode interpolationMode = InterpolationModeDefault;
switch (interpolation)
{
default:
return false;
}
- m_context->SetInterpolationMode(interpolationMode);
+
+ if ( m_context->SetInterpolationMode(interpolationMode) != Gdiplus::Ok )
+ return false;
+
+ m_interpolation = interpolation;
+
return true;
}
DeleteObject(iconInfo.hbmMask);
}
-void wxGDIPlusContext::DoDrawFilledText(const wxString& str,
- wxDouble x, wxDouble y,
- const wxGraphicsBrush& brush)
+void wxGDIPlusContext::DoDrawText(const wxString& str,
+ wxDouble x, wxDouble y )
{
if (m_composition == wxCOMPOSITION_DEST)
return;
wxGDIPlusFontData * const
fontData = (wxGDIPlusFontData *)m_font.GetRefData();
- wxGDIPlusBrushData * const
- brushData = (wxGDIPlusBrushData *)brush.GetRefData();
-
+
m_context->DrawString
(
str.wc_str(*wxConvUI), // string to draw, always Unicode
fontData->GetGDIPlusFont(),
PointF(x, y),
StringFormat::GenericTypographic(),
- brushData ? brushData->GetGDIPlusBrush()
- : fontData->GetGDIPlusBrush()
+ fontData->GetGDIPlusBrush()
);
}