Re: swftophp

peter <[email protected]> Sat, 4 Oct 2003 02:09:31 +0200
Newsgroups gmane.comp.web.ming.general
Message-ID <[email protected]>
Short anwser:
Before 

printf("\t$m = new SWFMovie();\n");

in swftophp.c add

printf("\tMing_setScale(1);\n");


Long anwser:
Default scale was changed sometime from 1 to 20 in ming, but the swftophp 
wasn't updated in this point. Look in swftoperl.c, where this and the 
setVersion is fixed.

No, there is currently no option to alter the scale in swftophp or any other 
tools in the util/ directory of ming-cvs.

If you want to work in pixels instead of twips, you can switch the scale 
everywhere you need to do this in the outputscript when adding/changing code 
to the outputscript.

The possibility to set the Mingscale for swftophp could also add an 
"accuracyerror" to the values. Thats because mingfunction currently only 
accept integers as parameters and ignore numbers after comma.

Example: Asume a shape is defined in a swf as 
drawLine(1234,0); (in twips = Mingscale=1)
So this is a line 1234/20= 61.7 pixels long. (if you wonder, commavalues have 
effect in antialiasing and naturally add accuracy for zoomed objects)
All is ok.

If you now set the Mingscale to 20, then
swftophp would (if somebody implement this option) write:
drawLine(61.7,0);
Until this step ok.

But ming would write in the new generated swf: 
drawLine(1220,0); (61*20)
and not as you maybe asume
drawLine(1234,0); (61.7*20)

So before somebody add this feature to swftophp and the other tools, the 
minglib should be modified/fixed to support commavalues and round the values 
internal to twips.

peterdd