views:

607

answers:

4

I've been looking for a long time for a way to have a bitmap from a VML document. In fact, I working on a few libs that use the tag, so I have no problem for anything except for IE (of course) because I'm using ExCanvas in IE, but I'd like to have a bitmap from the generated "canvas" (which is in fact VML).

I've been looking for a few ways to get a bitmap in JS from the VML, but I abandoned this idea, now I'd like to find a server side lib that is able to get a VML string and convert it to a bitmap image. My preferred language is PHP, but if there aren't any in this language, it'll be OK. I also looked at a Java applet that could do that, but this is in fact impossible without a signed one, this is not possible.

Thank you for your reply !

+1  A: 

You could use something like CutyCapt to allow the browser to render it and capture that to an image.

TML
Thank you for this tool, in fact I need the IE version (your page has a link to it : http://iecapt.sourceforge.net/). I didn't know it, but unfortunately, it requires an url to take a screenshot, I would like to take a screenshot of the current page, when I want to.
Fabien Ménager
A: 

I found a library which looks like the best solution to my problem : VectorConverter. It has however a few problems :

  • it only supports a very limited part of the spec
  • it is not maintained anymore
  • the code is not very well written and it doesn't use an existing DOM parser for the VML
  • I don't have time to enhance it !

So if anyone with a lot of time and who is interested in this project is welcome to work on it, and maybe fork it. Contact me if you plan to work on it, I may help you.

Fabien Ménager
A: 

The simple possibility is to use C# to display a window loading the vml page in ie webbrowser control and use this.webBrowser.Navigate("file.html") to load the vml page included in the html and then make a snap shot by capturing the image automatically by using graphic.CopyFromScreen function

Khatib
A: 

Hi Fabien,

I had a problem as your topic above. I use exCanvas as well to generate vml code in canvas tag on IE browser. I try to covert it to gif with VectorConverter, but all not running well.

php vc.php -gif [vml file] result.gif

I wish, if you had any suggestion an step that I can do to accomplish the problem, please guide me.

All suggestion will be appreciate.

Regards,

Mardi V. Tamma

Mardi V. Tamma
Hello, I also tried this lib, and on the first sight, it looks good, but I couldn't get it to work, event with hacks. So I abandoned, and found other libs like ExCanvas which are not based on VML, which is very buggy and poor. These libs are FxCanvas and FlashCanvas. FxCanvas is based on FlashCanvas, which has a professional support in its "Pro" version. Good luck!
Fabien Ménager
Thank you Fabien. I'll try to implement that library. Again, Thank you.
Mardi V. Tamma
I solve my problem now, You're right Flash Canvas had a feauture to save canvas into image (.png). it has saveCanvas() function where we can trigger it from any action. anyway, Thank you for your suggestion to Flash Canvas API.
Mardi V. Tamma