Set background colour of saved image in drawing sample

Initialize background colour prior to actual drawing to make it uniform for all kinds of drawing operations.
This commit is contained in:
Artur Wieczorek 2017-03-06 18:47:01 +01:00
parent 15ee1ebd12
commit 92b64ff997

View File

@ -2315,6 +2315,8 @@ void MyFrame::OnSave(wxCommandEvent& WXUNUSED(event))
{
wxBitmap bmp(width, height);
wxMemoryDC mdc(bmp);
mdc.SetBackground(*wxWHITE_BRUSH);
mdc.Clear();
m_canvas->Draw(mdc);
bmp.ConvertToImage().SaveFile(dlg.GetPath());
}