Fixed image insertion in the wxRTC sample

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2013-10-12 06:15:07 +00:00
parent 6fb9f7ee28
commit 4f24610ee9

View File

@ -2060,11 +2060,13 @@ void MyFrame::OnInsertURL(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnInsertImage(wxCommandEvent& WXUNUSED(event))
{
wxFileDialog dialog(this, _("Choose an image"), "", "", "BMP and GIF files (*.bmp;*.gif)|*.bmp;*.gif|PNG files (*.png)|*.png");
wxFileDialog dialog(this, _("Choose an image"), "", "", "BMP and GIF files (*.bmp;*.gif)|*.bmp;*.gif|PNG files (*.png)|*.png|JPEG files (*.jpg;*.jpeg)|*.jpg;*.jpeg");
if (dialog.ShowModal() == wxID_OK)
{
wxString path = dialog.GetPath();
m_richTextCtrl->WriteImage(path, wxBITMAP_TYPE_ANY);
wxImage image;
if (image.LoadFile(path) && image.GetType() != wxBITMAP_TYPE_INVALID)
m_richTextCtrl->WriteImage(path, image.GetType());
}
}