X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b166c70307f14952b3844837c98602425020e1c5..f63e3ebbe3272b9690aa2530e0c3048d3f37c7c7:/wxPython/demo/wxDragImage.py diff --git a/wxPython/demo/wxDragImage.py b/wxPython/demo/wxDragImage.py index d53fb4c67b..8814df9c04 100644 --- a/wxPython/demo/wxDragImage.py +++ b/wxPython/demo/wxDragImage.py @@ -64,18 +64,19 @@ class DragCanvas(wxScrolledWindow): # Make a shape from some text text = "Some Text" + bg_colour = wxColour(57, 115, 57) # matches the bg image font = wxFont(15, wxROMAN, wxNORMAL, wxBOLD) textExtent = self.GetFullTextExtent(text, font) bmp = wxEmptyBitmap(textExtent[0], textExtent[1]) dc = wxMemoryDC() dc.SelectObject(bmp) + dc.SetBackground(wxBrush(bg_colour, wxSOLID)) dc.Clear() dc.SetTextForeground(wxRED) dc.SetFont(font) dc.DrawText(text, 0, 0) dc.SelectObject(wxNullBitmap) - del dc - mask = wxMaskColour(bmp, wxWHITE) + mask = wxMaskColour(bmp, bg_colour) bmp.SetMask(mask) shape = DragShape(bmp) shape.pos = wxPoint(5, 100)