Example #1
0
        public void Render(ISvgElement node)
        {
            //throw new NotImplementedException();

            //SvgRectF updatedRect;
            //if (invalidRect != SvgRectF.Empty)
            //    updatedRect = new SvgRectF(invalidRect.X, invalidRect.Y,
            //        invalidRect.Width, invalidRect.Height);
            //else
            //    updatedRect = SvgRectF.Empty;

            //RendererBeforeRender();

            //if (graphics != null && graphics.Graphics != null)
            //{
            //    _svgRenderer.Render(node);
            //}

            //RendererAfterRender();

            //if (onRender != null)
            //    OnRender(updatedRect);

            _renderingContext = new WpfDrawingContext(true,
                                                      _renderingSettings);

            _renderingContext.Initialize(null, _fontFamilyVisitor, _imageVisitor);

            _renderingContext.BeginDrawing();

            _svgRenderer.Render(node);

            _renderingContext.EndDrawing();
        }
        public void Render(ISvgDocument node)
        {
            //SvgRectF updatedRect;
            //if (invalidRect != SvgRectF.Empty)
            //    updatedRect = new SvgRectF(invalidRect.X, invalidRect.Y,
            //        invalidRect.Width, invalidRect.Height);
            //else
            //    updatedRect = SvgRectF.Empty;

            //RendererBeforeRender();

            //_renderingContext = new WpfDrawingContext(new DrawingGroup());
            if (_svgRenderer == null)
            {
                _svgRenderer = new WpfRenderingHelper(this);
            }

            _context = new WpfDrawingContext(_isEmbedded, _settings);

            _context.Initialize(_linkVisitor, _fontFamilyVisitor, _imageVisitor);

            _context.BeginDrawing(_drawingDocument);

            _svgRenderer.Render(node);

            _context.EndDrawing();

            //RendererAfterRender();

            //if (onRender != null)
            //    OnRender(updatedRect);
        }
Example #3
0
        public void Render(ISvgDocument node)
        {
            //SvgRectF updatedRect;
            //if (invalidRect != SvgRectF.Empty)
            //    updatedRect = new SvgRectF(invalidRect.X, invalidRect.Y,
            //        invalidRect.Width, invalidRect.Height);
            //else
            //    updatedRect = SvgRectF.Empty;

            //RendererBeforeRender();

            //_renderingContext = new WpfDrawingContext(new DrawingGroup());
            if (_svgRenderer == null)
            {
                _svgRenderer = new WpfRenderingHelper(this);
            }

            var isStatic = node.Static;

            node.Static = true;

            _context = new WpfDrawingContext(_isEmbedded, _settings);

            _context.Initialize(_linkVisitor, _fontFamilyVisitor, _imageVisitor);

            if (!_isEmbedded)
            {
                if (_svgWindow != null && _svgWindow.BaseUrls == null)
                {
                    _svgWindow.BaseUrls = _context.BaseUrls;
                }
            }

            _context.BeginDrawing(_drawingDocument);

            _svgRenderer.Render(node);

            _context.EndDrawing();

            if (!_isEmbedded)
            {
                if (_svgWindow != null && _svgWindow.BaseUrls != null && _svgWindow.BaseUrls.Count != 0)
                {
                    _svgWindow.BaseUrls.Clear();
                }

                node.Static = isStatic;
            }

            //RendererAfterRender();

            //if (onRender != null)
            //    OnRender(updatedRect);
        }