예제 #1
0
 public void Redraw()
 {
     using (DrawingContext drawingContext = base.RenderOpen())
     {
         Geometry geometry;
         Rect     rect;
         StrokeRenderer.CalcGeometryAndBounds(StrokeNodeIterator.GetIterator(this.Stroke, this._drawingAttributes), this._drawingAttributes, false, out geometry, out rect);
         drawingContext.DrawGeometry(this._brush, null, geometry);
     }
 }
예제 #2
0
        public void Redraw(StylusPointCollection stylusPoints)
        {
            Geometry geometry;
            Rect     rect;

            StrokeRenderer.CalcGeometryAndBounds(StrokeNodeIterator.GetIterator(stylusPoints, this._drawingAttributes), this._drawingAttributes, false, out geometry, out rect);
            DrawingContext drawingContext = base.RenderOpen();

            try
            {
                drawingContext.DrawGeometry(this._brush, null, geometry);
            }
            finally
            {
                if (drawingContext != null)
                {
                    ((IDisposable)drawingContext).Dispose();
                }
            }
        }