How to avoid flickering when drawing rubberband?

Hi,

I found the solution while tweaking the demo code and posted here. I don’t understand why dc = wx.GCDC(dc) is required for transparency but it works on Windows. I hope someone explains.