I just wanted to integrate the opencv video stream from my web cam into a more complex gui than highgui can offer, nothing fancy just a couple of buttons and something else,
You should add a comment for the below line
#self.PrepareDC(dc)
It worked for me.