X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b87c90c18c92848ad8eddd9eadc30c2e80a7ea11..c3016fd626994c6f9f555e03076a497eb1f5797c:/samples/drawing/drawing.cpp?ds=sidebyside diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index a019bf45cd..5c71ee2b09 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -37,13 +37,14 @@ #include "wx/colordlg.h" #include "wx/image.h" +#include "wx/artprov.h" // ---------------------------------------------------------------------------- // ressources // ---------------------------------------------------------------------------- // the application icon -#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) +#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__) #include "mondrian.xpm" #endif @@ -368,7 +369,7 @@ MyCanvas::MyCanvas(MyFrame *parent) m_owner = parent; m_show = Show_Default; m_smile_bmp = wxBitmap(smile_xpm); - m_std_icon = wxTheApp->GetStdIcon(wxICON_INFORMATION); + m_std_icon = wxArtProvider::GetIcon(wxART_INFORMATION); } void MyCanvas::DrawTestBrushes(wxDC& dc) @@ -474,10 +475,12 @@ void MyCanvas::DrawDefault(wxDC& dc) { // mark the origin dc.DrawCircle(0, 0, 10); -#if !(defined __WXGTK__) && !(defined __WXMOTIF__) && !(defined __WXMGL__) - // not implemented in wxGTK or wxMOTIF :-( - dc.FloodFill(0, 0, wxColour(255, 0, 0)); -#endif // + + //flood fill using brush, starting at 1,1 and replacing whatever colour we find there + dc.SetBrush(wxBrush(wxColour(128,128,0), wxSOLID)); + wxColour tmpColour ; + dc.GetPixel(1,1, &tmpColour); + dc.FloodFill(1,1, tmpColour, wxFLOOD_SURFACE); dc.DrawCheckMark(5, 80, 15, 15); dc.DrawCheckMark(25, 80, 30, 30); @@ -553,9 +556,9 @@ void MyCanvas::DrawDefault(wxDC& dc) memdc.SelectObject( wxNullBitmap ); dc.DrawBitmap( bitmap, 10, 170 ); - wxImage image( bitmap ); + wxImage image = bitmap.ConvertToImage(); image.Rescale( 60,210 ); - bitmap = image.ConvertToBitmap(); + bitmap = wxBitmap(image); dc.DrawBitmap( bitmap, 50, 170 ); // test the rectangle outline drawing - there should be one pixel between