以下是源代码
//保存图片
void MyFrame::OnSave(wxCommandEvent& event)
{
int a = 1;
wxString caption = wxT("图片");
wxString wildcard = wxT("All files|*|JPEG(*.jpeg;*.jpg;*.jpe;*.jfif)|*.jpeg;*.jpg;*.jpe;*.jfif|BMP(*.bmp)|*.bmp|PNG(*.png)|*.png|GIF(*.gif)|*.gif");
wxString defaultDir = wxT("c:\\temp");
wxString defaultFilename = wxEmptyString;
wxFileDialog *dialog = new wxFileDialog(this, caption, defaultDir, defaultFilename, wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
if (dialog->ShowModal() == wxID_CANCEL)
return;
text1 = new wxTextCtrl();
text1->SaveFile(dialog->GetPath());
dialog->Destroy();
}