[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swftools-common] Problems with PNG placement
From: |
nevenq |
Subject: |
Re: [Swftools-common] Problems with PNG placement |
Date: |
Thu, 18 Mar 2010 13:09:47 +0100 |
I have the same problem with image positioning while moving or rotating
an image.
If I compile this code:
.flash bbox=200x100 filename="ftest1.swf" fps=25
.png slika1 "pict01.png"
.put slika1 pin=center x=100 y=50 scale=0%
.frame 50
.change slika1 rotate=360 scale=100%
.frame 100
.end
the picture finnishes as rotated for only around 350 degrees (see
attachment p1.png).
If I, trying to compensate, change the code to this:
.flash bbox=200x100 filename="ftest1.swf" fps=25
.png slika1 "pict01.png"
.put slika1 pin=center x=100 y=50 scale=0%
.frame 50
.change slika1 rotate=361 scale=100%
.frame 51
.change slika1 rotate=360
.frame 100
.end
then it is almost correct, but not quite (rotated around 358 degrees).
But if I change the code as Mick suggested (thanks Mick!), it ends up
rotated correctly (of course, in HTML embedding code I leave width=200
and height=100):
.flash bbox=2000x1000 filename="ftest1.swf" fps=25
.png slika1 "pict01.png"
.put slika1 pin=center x=1000 y=500 scale=0%
.frame 50
.change slika1 rotate=360 scale=1000%
.frame 100
.end
The swfc version I'm using is 0.9.0 and was installed in Ubuntu 9.10
from Ubuntu repositories. I checked viewing the .swf with Opera and
Firefox browser, in Ubuntu Linux, and WinXP, and I get the same results
in all of them.
Regards,
nevenq
> Hi Chris,
>
> Refusing to give up, I took a look at some of the code. Twips seem
> to crop up quite a lot in various routines. I had assumed the metric
> used for size, position etc. was pixels. Out of interest I
> multiplied all my pixel values by 20 to convert them to twips. This
> gave:
>
> .flash filename="test_swfc.swf" version=6 fps=50 bbox=8700x2440
> .png img1 filename="test.png"
> .put img1 scalex=8700 scaley=2440
> .end
>
>
> The image now renders perfectly. The HTML maintains the original size
> in pixels as specified by the object tag. Notice I had to add the
> scalex and scaley properties to the .put command. Additionally, any
> subsequent zooming or moving of the image is now carried out with a
> great deal more accuracy.
>
> I'm still not sure I fully understand why this method works better.
> It would be nice if someone could maybe explain what is happening
> under the bonnet and how twips and pixels fit into the bigger picture.
> Anyway, for now I have a workaround :-)
>
> Cheers,
> Mick
p1.png
Description: PNG image
pict01.png
Description: PNG image