コード例 #1
0
ファイル: TestRender.cs プロジェクト: bromose/SVG
        public void TestRenderWImage()
        {
            var builder = new SvgBuilder();
            var doc     = builder.Open(new MemoryStream(TestingSources.WithImage));

            SaveBitmap(doc.Draw(), "TestRenderWImage.png");
        }
コード例 #2
0
        /// <summary>
        /// Opens an SVG document from the specified <see cref="Stream"/> and adds the specified entities.
        /// </summary>
        /// <param name="stream">The <see cref="Stream"/> containing the SVG document to open.</param>
        /// <param name="entities">Custom entity definitions.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="stream"/> parameter cannot be <c>null</c>.</exception>
        public static T Open <T>(Stream stream, Dictionary <string, string> entities) where T : SvgDocument, new()
        {
            var builder = new SvgBuilder(Activator.CreateInstance <T>);

            return((T)builder.Open(stream, entities));
        }