/// <summary>
 /// Initializes a new instance of the <see cref="SvgRenderContext"/> class.
 /// </summary>
 /// <param name="path">The path.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="textMeasurer">The text measurer.</param>
 public SvgRenderContext(string path, double width, double height, IRenderContext textMeasurer)
 {
     this.w = new SvgWriter(path, width, height);
     this.Width = width;
     this.Height = height;
     this.TextMeasurer = textMeasurer;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SvgRenderContext"/> class.
 /// </summary>
 /// <param name="path">The path.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="textMeasurer">The text measurer.</param>
 public SvgRenderContext(string path, double width, double height, IRenderContext textMeasurer)
 {
     this.w            = new SvgWriter(path, width, height);
     this.Width        = width;
     this.Height       = height;
     this.TextMeasurer = textMeasurer;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SvgRenderContext"/> class.
 /// </summary>
 /// <param name="s">The s.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="isDocument">Create an SVG document if set to <c>true</c>.</param>
 /// <param name="textMeasurer">The text measurer.</param>
 public SvgRenderContext(Stream s, double width, double height, bool isDocument, IRenderContext textMeasurer)
 {
     this.w = new SvgWriter(s, width, height, isDocument);
     this.Width = width;
     this.Height = height;
     this.PaintBackground = true;
     this.TextMeasurer = textMeasurer;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SvgRenderContext"/> class.
 /// </summary>
 /// <param name="s">The s.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="isDocument">Create an SVG document if set to <c>true</c>.</param>
 /// <param name="textMeasurer">The text measurer.</param>
 public SvgRenderContext(Stream s, double width, double height, bool isDocument, IRenderContext textMeasurer)
 {
     this.w               = new SvgWriter(s, width, height, isDocument);
     this.Width           = width;
     this.Height          = height;
     this.PaintBackground = true;
     this.TextMeasurer    = textMeasurer;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SvgRenderContext" /> class.
        /// </summary>
        /// <param name="s">The s.</param>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        /// <param name="isDocument">Create an SVG document if set to <c>true</c>.</param>
        /// <param name="textMeasurer">The text measurer.</param>
        /// <param name="background">The background.</param>
        public SvgRenderContext(Stream s, double width, double height, bool isDocument, IRenderContext textMeasurer, OxyColor background)
        {
            if (textMeasurer == null)
            {
                throw new ArgumentNullException("textMeasurer", "A text measuring render context must be provided.");
            }

            this.w            = new SvgWriter(s, width, height, isDocument);
            this.TextMeasurer = textMeasurer;
            if (background.IsVisible())
            {
                this.w.WriteRectangle(0, 0, width, height, this.w.CreateStyle(background, OxyColors.Undefined, 0));
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SvgRenderContext" /> class.
        /// </summary>
        /// <param name="s">The s.</param>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        /// <param name="isDocument">Create an SVG document if set to <c>true</c>.</param>
        /// <param name="textMeasurer">The text measurer.</param>
        /// <param name="background">The background.</param>
        public SvgRenderContext(Stream s, double width, double height, bool isDocument, IRenderContext textMeasurer, OxyColor background)
        {
            if (textMeasurer == null)
            {
                throw new ArgumentNullException("textMeasurer", "A text measuring render context must be provided.");
            }

            this.w = new SvgWriter(s, width, height, isDocument);
            this.TextMeasurer = textMeasurer;
            if (background != null)
            {
                this.w.WriteRectangle(0, 0, width, height, this.w.CreateStyle(background, null, 0));
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SvgRenderContext" /> class.
        /// </summary>
        /// <param name="s">The stream.</param>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        /// <param name="isDocument">Create an SVG document if set to <c>true</c>.</param>
        /// <param name="textMeasurer">The text measurer.</param>
        /// <param name="background">The background.</param>
        /// <param name="useVerticalTextAlignmentWorkaround">Whether to use the workaround for vertical text alignment.</param>
        public SvgRenderContext(Stream s, double width, double height, bool isDocument, IRenderContext textMeasurer, OxyColor background, bool useVerticalTextAlignmentWorkaround = false)
        {
            if (textMeasurer == null)
            {
                throw new ArgumentNullException("textMeasurer", "A text measuring render context must be provided.");
            }

            this.w            = new SvgWriter(s, width, height, isDocument);
            this.TextMeasurer = textMeasurer;
            this.UseVerticalTextAlignmentWorkaround = useVerticalTextAlignmentWorkaround;

            if (background.IsVisible())
            {
                this.w.WriteRectangle(0, 0, width, height, this.w.CreateStyle(background, OxyColors.Undefined, 0), EdgeRenderingMode.Adaptive);
            }
        }