Ok,
I figured it out:
On Firefox, when using the echart's test site, I'm being prompted by Firefox what I want to do with the file.
Then I did the same test on Chrome and I was NOT prompted but the file went straight to my downloads folder.
Since the webbrowser control is Chrome-based, I tried specifying the filename and now it works. The image is being saved into the folder that I have set in the application's open event:
int li_ret
string ls_ret
li_ret = WebBrowserGet("UserAgent", ref ls_ret)
if ls_ret = "" then
li_ret = WebBrowserSet("UserAgent", "AppeonWebBrowser")
if li_ret <> 1 then
Messagebox("Information", "Error setting the UserAgent for the WebBrowser", information!)
end if
end if
li_ret = WebBrowserSet("DownloadPath", "c:\temp2")
if li_ret <> 1 then
Messagebox("Information", "Error setting the DownloadPath for the WebBrowser", information!)
end if
li_ret = WebBrowserSet("allow-file-access-from-files", "true")
if li_ret <> 1 then
Messagebox("Information", "Error setting the FileAccess for the WebBrowser", information!)
end if
In my "options" string I had "saveAsImage: {},", but that doesn't work. You have to specify a filename, so I've changed it to be:
....
saveAsImage: {
name: "hello"
},
.....
I'll find a file called C:\temp2\hello.png :)
In my case there's no need for a path, since I've already set the DownLoadPath with WebBrowserSet and no need for a file extension, since by default the 'renderer' is set to 'canvas' (not 'svg') and the default extension would be 'png' in that case.
The toolbox does disappear temporarily (until I move the mouse), but that might be because it's overlaying my graph.
So now the only thing I have to do is try to figure out how to set 'renderer' to 'svg', but I think that would work, just have to check on to possible JS commands. (don't know if I have to include ".style" or not in of_apply() of the demo application made by Appeon).
I'll post it once I've checked on that, SVG graphics might be more useful than PNG or JPG.
Well problem solved!
Thanks Armeen!