From 92b64ff997afe3a73810ea256a050cea0b9b346f Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 6 Mar 2017 18:47:01 +0100 Subject: [PATCH] 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. --- samples/drawing/drawing.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 62ff65f4b1..ba6070de97 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -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()); }