def on_paint(self, e=None): dc = BufferedPaintDC(self) # Draw empty background b = wx.WHITE_BRUSH #Brush(Color(40, 40, 40)) @UndefinedVariable #b.SetStipple(self.stipple) dc.Brush = b dc.Pen = wx.TRANSPARENT_PEN #@UndefinedVariable dc.DrawRectangle(0, 0, *self.Size) # Draw the bitmap self.paint_bitmap(dc) # Draw the picker square dc.Brush = wx.TRANSPARENT_BRUSH #@UndefinedVariable dc.Pen = wx.RED_PEN #@UndefinedVariable x, y = self.middle x -= self.picksize[0] / 2 y -= self.picksize[1] / 2 dc.SetLogicalFunction(wx.INVERT) dc.DrawRectangle(x, y, self.picksize[0], self.picksize[1])