I have a HTML application, partially HTML, partially VBscript, disguised as a form. What it does is it opens a few local files, runs a DOS box containing GAWK and presents a text file as its result. I wish to expand upon it by letting it create a bitmap image with the results in a stacked bar graph, for instance as a .BMP file. But I'm stumped. I haven't the faintest idea where to start.
Is javascript an option? That would be a lot easier than creating an image file.
I have used this jquery plugin http://code.google.com/p/flot/ a few times and works well.
I have not used VBScript for a few years now, think you would probably need to use an active-x object of some kind to generate an image file, but I could be wrong there.
Graphics are beyond the capabilities of VBScript alone. You can try if you find an ActiveX/COM component that can do it for you. Looking into Google, my guess is that most of them come as dumbed-down trial versions of quite expensive commercial products. Maybe someone else here knows one that is for free.
As an alternative route, you could set up a web service somewhere that does the image processing (for example PHP/gdlib) using URL parameters. Then you would just have to link to the image in your HTA with an <img>
tag like you normally would.
I believe you will be able to use this library http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm in VBScript too. It can be used to draw all kinds of shapes lines, rectangles, circles etc
Once you have drawn the graph you can print the page to a PDF printer (like cutePDF) to get the image onto a file for later use.
The Microsoft Scripting Guys came out with an article which discussed his quite a while ago, but it involves using the Excel ActiveX control or the OWC control the article is really detailed in how to do it, look here: http://www.microsoft.com/technet/scriptcenter/topics/activex/chart.mspx