Code: Select all
//that is my class
class myImage : public wxStaticBitmap {
public:
wxBitmap frame; //imagem
myImage(wxWindow* parent, wxWindowID id, wxPoint pos, wxSize size, wxBitmap frame);
private:
void redesenha();
void mouseUp(wxMouseEvent& event);
void mouseDown(wxMouseEvent& event);
void mouseMove(wxMouseEvent& event);
wxDECLARE_EVENT_TABLE();
};
meuCanvas::myImage(wxWindow* parent, wxWindowID id, wxPoint pos, wxSize size, wxBitmap frame): wxStaticBitmap(parent, id, frame, pos, size){
this->frame = frame;
}
//that is my function to clear my image
void myFrame::onClickClear(wxCommandEvent& event)
{
wxClientDC dc(myImg);
dc.SetBackground(wxBrush(myImg->frame)); //frame is a wxBitmap type
dc.Clear();
}