wxGraphicsContext and wxAutoBufferedPaintDC

Kevin Ollivier kevin-lists at theolliviers.com
Mon May 5 17:56:10 PDT 2008


Hi Robert,

On May 5, 2008, at 4:25 PM, Robert Hölzl wrote:

> hello,
>
> how can I use a wxGraphicsContext in a wxAutoBufferedPaintDC (on  
> windows my application is flickering extremly)?
> according to the documentation only a WindowsDC can be specified as  
> parameter to wx.GraphicsContext.Create(), but  
> wx.AutoBufferedPaintDC() is not inherited from WindowsDC...
>
> I did my tests on wxPython 2.8.7 on a Mac and as expected it didn’t  
> work.
>
> Is there no way to use the graphicscontext with buffered paintdcs?

For wxWebKit, we use the wxGCDC layer as a 'bridge' between the two.  
So, in your case, you'd code it like so:

def OnPaint(self, event):
	paintdc = wx.AutoBufferedPaintDC(self)
	gcdc = wx.GCDC(paintdc)

	graphics_context = gcdc.GetGraphicsContext()

	# do painting with your graphics_context object

It would be nice to go straight from one to the other, though.

Regards,

Kevin

>
>
> thanks a lot for help in advance,
> robert_______________________________________________
> wx-users mailing list
> wx-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-users



More information about the wx-users mailing list