I need to draw a polyline in DrawingVisual. For performance reasons, I use StreamGeometry. The problem is that I cannot figure out how to enable anti-aliasing. I cannot find any StreamGeometry or DrawingContext method or property to control anti-aliasing.
The code below is in IronPython, but that doesn't matter:
geometry = StreamGeometry()
context = geometry.Open()
context.BeginFigure(Point(10, 10), False, False)
context.LineTo(Point(100, 100), True, False)
context.LineTo(Point(200, 300), True, False)
context.Close()
dv = DrawingVisual()
dc = dv.RenderOpen()
dc.DrawGeometry(None, Pen(Brushes.Blue, 1), geometry)
dc.Close()
source
share