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:
parent
15ee1ebd12
commit
92b64ff997
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user