PeachDrawing.Svg

SvgComposer Class

Makes one SVG document. The Canvas is what you draw on, and Save(Stream) writes what was drawn; an SVG has no pages, so there is one composer per document. Like the PDF composer, it works in points with the origin at the top left and y growing downwards.

public sealed class SvgComposer

Inheritance System.Object → SvgComposer

Example

var context = new SvgRenderContext();
var composer = new SvgComposer(context, 400, 200);
composer.Canvas.DrawRectangle(context.GetSolidBrush(PaintColor.FromArgb(255, 30, 144, 255)), 20, 20, 200, 100);
composer.Save(File.Create("out.svg"));
Constructors  
SvgComposer(SvgRenderContext, double, double, SvgComposerOptions) Starts a document.
Properties  
Canvas The canvas the document is drawn on, in the render context’s layout units (PixelsPerPoint of them to a point).
HeightPoints The document height, in points.
Options What is written into the document.
RenderContext The context the document draws with.
WidthPoints The document width, in points.
Methods  
Save(Stream) Writes the document (UTF-8, no byte order mark).
Save(TextWriter) Writes the document.
ToSvg() The document as its SVG text.