Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: JScript Panel script discussion/help (Read 165250 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: JScript Panel script discussion/help

Reply #950
width and height are whatever you want the returned image to be. That's the whole point of SVG, the source can be any size and you get a scaled image without quality loss.

If you loaded a tiny 16x16px png file with utils.LoadImage and then used the Resize method to make it 1024x1024, it would look terrible.

 

Re: JScript Panel script discussion/help

Reply #951
Just as a follow up, you can parse XML with ActiveXObjects like this...

Code: [Select]
var svg_file = fb.ComponentPath + 'samples\\svg\\android.svg';
var svg_text = utils.ReadUTF8(svg_file);

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
xmlDoc.async = false;
xmlDoc.loadXML(svg_text);
if (xmlDoc.parseError.errorCode == 0) {
var svg = xmlDoc.childNodes[0];
       // width / height not present in the android.svg but you could access them if you know they are with other content
console.log(svg.getAttribute("viewBox"));
}

Re: JScript Panel script discussion/help

Reply #952
Hi Marc,
Tested the update this morning with the new SVG library
It looks better, the pie close correctly at 360°, thanks !!
here is the result :
X

i will try to check if it accepts "text" but i think i read it was not using it.


Re: JScript Panel script discussion/help

Reply #954
yep, thanks, i tried it, it seems the <text> tag is not recognized.
this library seems much better than the other one though.