Exemple #1
0
 public void BeginRender()
 {
     if (_svgRenderer == null)
     {
         _svgRenderer = new WpfRenderingHelper(this);
     }
 }
        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);
        }
Exemple #3
0
        public WpfDrawingRenderer(WpfDrawingSettings settings, bool isEmbedded)
        {
            _isEmbedded  = isEmbedded;
            _svgRenderer = new WpfRenderingHelper(this);
            _settings    = settings;

            _interactiveMode = isEmbedded ? SvgInteractiveModes.None : settings.InteractiveMode;
        }
        public void BeginRender(WpfDrawingDocument drawingDocument)
        {
            if (_svgRenderer == null)
            {
                _svgRenderer = new WpfRenderingHelper(this);
            }

            _drawingDocument = drawingDocument;
        }
Exemple #5
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);
        }
        public void Render(ISvgElement node, WpfDrawingContext context)
        {
            //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);

            if (_svgRenderer == null)
            {
                _svgRenderer = new WpfRenderingHelper(this);
            }

            if (context == null)
            {
                _context = new WpfDrawingContext(true, _settings);

                _context.Initialize(null, _fontFamilyVisitor, _imageVisitor);
            }
            else
            {
                _context = context;
            }

            _context.BeginDrawing(_drawingDocument);

            _svgRenderer.Render(node);

            _context.EndDrawing();
        }
        public void RenderAs(SvgElement node, WpfDrawingContext context)
        {
            if (_svgRenderer == null)
            {
                _svgRenderer = new WpfRenderingHelper(this);
            }

            if (context == null)
            {
                _context = new WpfDrawingContext(true, _settings);

                _context.Initialize(null, _fontFamilyVisitor, _imageVisitor);
            }
            else
            {
                _context = context;
            }

            _context.BeginDrawing(_drawingDocument);

            _svgRenderer.RenderAs(node);

            _context.EndDrawing();
        }
 public WpfDrawingRenderer(WpfDrawingSettings settings, bool isEmbedded)
 {
     _isEmbedded  = isEmbedded;
     _svgRenderer = new WpfRenderingHelper(this);
     _settings    = settings;
 }
 public void EndRender()
 {
     _svgRenderer     = null;
     _drawingDocument = null;
 }
Exemple #10
0
 public WpfDrawingRenderer(WpfDrawingSettings settings)
 {
     _svgRenderer       = new WpfRenderingHelper(this);
     _renderingSettings = settings;
 }
Exemple #11
0
 public WpfDrawingRenderer()
 {
     _svgRenderer = new WpfRenderingHelper(this);
 }
 public WpfDrawingRenderer(WpfDrawingSettings settings)
 {
     _svgRenderer       = new WpfRenderingHelper(this);
     _renderingSettings = settings;
 }
 public WpfDrawingRenderer()
 {
     _svgRenderer = new WpfRenderingHelper(this);
 }
Exemple #14
0
 public void EndRender()
 {
     _svgRenderer = null;
 }