X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/45647dcf1059cc6515a0c6157f7c077cfc2abd31..19e30148e18cc99296b26503c155e5cef59045f4:/samples/image/image.cpp?ds=sidebyside diff --git a/samples/image/image.cpp b/samples/image/image.cpp index 60dac7ff8d..262078f92c 100644 --- a/samples/image/image.cpp +++ b/samples/image/image.cpp @@ -138,7 +138,7 @@ public: void OnSave(wxCommandEvent& WXUNUSED(event)) { - wxImage image(m_bitmap); + wxImage image = m_bitmap.ConvertToImage(); int bppselection = wxGetSingleChoiceIndex("Set BMP BPP", "Set BMP BPP", @@ -317,7 +317,8 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, #if wxUSE_GIF image.Destroy(); - if ( !image.LoadFile( dir + wxString("horse.gif")) ) + if ( !image.LoadFile( dir + wxString("horse.gif"))) + //if ( !image.LoadFile( wxString("\\slidbar.gif"), wxBITMAP_TYPE_GIF, -2) ) wxLogError(wxT("Can't load GIF image")); else my_horse_gif = new wxBitmap( image ); @@ -430,6 +431,7 @@ MyCanvas::~MyCanvas() delete my_horse_ico32; delete my_horse_ico16; delete my_horse_ico; + delete my_horse_cur; delete my_smile_xbm; delete my_square; delete my_anti; @@ -510,7 +512,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) wxRED_PEN->GetColour().Red(), wxRED_PEN->GetColour().Green(), wxRED_PEN->GetColour().Blue() ); - dc.DrawBitmap( i.ConvertToBitmap(), 150, 2010, TRUE ); + dc.DrawBitmap( wxBitmap(i), 150, 2010, TRUE ); dc.SetTextForeground( wxT("BLACK") ); } @@ -547,7 +549,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) wxRED_PEN->GetColour().Red(), wxRED_PEN->GetColour().Green(), wxRED_PEN->GetColour().Blue() ); - dc.DrawBitmap( i.ConvertToBitmap(), 150, 2130, TRUE ); + dc.DrawBitmap( wxBitmap(i), 150, 2130, TRUE ); dc.SetTextForeground( wxT("BLACK") ); } @@ -631,7 +633,7 @@ void MyCanvas::CreateAntiAliasedBitmap() blue = blue/4; anti.SetRGB( x, y, red, green, blue ); } - my_anti = new wxBitmap( anti.ConvertToBitmap() ); + my_anti = new wxBitmap(anti); } // MyFrame @@ -700,7 +702,7 @@ void MyFrame::OnNewFrame( wxCommandEvent &WXUNUSED(event) ) return; } - (new MyImageFrame(this, image.ConvertToBitmap()))->Show(); + (new MyImageFrame(this, wxBitmap(image)))->Show(); } //-----------------------------------------------------------------------------