tags:

views:

469

answers:

2

Is there a way in C# / .NET to render VML into a bitmap?

I'm thinking this should be really easy, but I can't seem to find anything like this in the .NET docs.

A: 

Any particular reason you're not using SVG instead? You'd have more luck finding libraries. I believe SVG is a successor to VML.

Chris
I figured since VML is built-in to about a gazillion Microsoft product, there would be a simple RenderThisYo(vml) call in the stdlib I could use. SVG is great, but I'd like to avoid the external dependency if possible, and I wasn't having much luck finding a C#/SVG lib, either.
Ken
+1  A: 

In looking for a similar solution I came across a 2 step process.

  1. convert the VML to SVG.
  2. render the SVG as an image.

SourceForge has an XSL based project to convert VML to SVG.

(sourceforge.net/projects/vectorconverter/)

I've been testing with it and it works OK in certain cases.

Next, the SVG to PNG handler on CodePlex. Once registered to process *.svg files, the handler will read the file and send the image back to the browser in .png format. You can download the source and see how it's done.

You could string the 2 steps together to get your bitmap from vml.

Tori Marrama