wx.PseudoDC and anti-aliased drawing

Is there any hack to anti-aliased the drawing operation in wx.PseudoDC
()?

Prashant

Python 2.6.2
wxPython 2.8.10.1
XP 32

King wrote:

Is there any hack to anti-aliased the drawing operation in wx.PseudoDC
()?

nope -- it's built on DCs, which don't support it.

I tried using self.Refresh() just before ending the OnMouseMotion
function but it produces flicker. self.Update() doesn't do anything.

you may well need double buffering:

http://wiki.wxpython.org/DoubleBufferedDrawing

That page was written quite some time ago, before GraphicsContexts -- but the principles still apply.

If you really want the drawing to update with every mouse movement, you may have delays/flickering no matter what you do, unless the drawing is very simple.

An alternative is some version of overlays: see the wxPython Demo and discussions on this list.

Aside from proper overlays, you can use double buffering, and blit the buffer to the screen, then over-draw just what is changing as the mouse moves.

This is what I've done in wx.lib.floatcanvas

However, you can save yourself a lot of trouble by using a pre-built drawing canvas. FloatCanvas doesn't support anti-aliasing (at least not very easily), but FloatCanvas 2 does -- it is currently only in SVN, but is likely to be included in future wxPython releases:

http://svn.wxwidgets.org/svn/wx/wxPython/3rdParty/branches/FloatCanvas/SOC2008_FloatCanvas/floatcanvas2/

-Chris

ยทยทยท

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov