swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] Problems with PNG placement


From: Mick
Subject: Re: [Swftools-common] Problems with PNG placement
Date: Mon, 15 Mar 2010 23:07:54 +0000
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

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

Chris Pugh wrote:
I though I forwarded this mail to the list, when you originally sent
it to me by mistake?

I did reply, on list ( or thought I had ).

As I said last time, one is a .png converted to an swf, the other is a
.png inside an swf, i.e. inside a bounding box.  The
rendering seems a tad odd on the compiled swf with the bottom left of
the yellow section of rectangle seem wider than the top left of same,
but adjusting the bounding box/positioning seems to sort the problem
out - at least according to my old eyes!   Maybe this is not really an
swftools issue?

Hopefully there is someone out there with better eyes, and a more
precise explanation as to what's actually
happening?

Regards,


Chris.

On 14 March 2010 15:19, Mick <address@hidden> wrote:
Hi Chris,

Not sure I explained the problem well enough. Let me try again. The first
row (top row) and first column (left column) of pixels in the image are
being duplicated. This is making the image one pixel wider and one pixel
longer and as a result the last row (bottom row) and last column (right
column) of pixels are not appearing (effectively being pushed off the
stage).

It would not be possible to see this with the image you attached in your
last message as all the pixels are red. If a black border, one pixel thick
were added around the edge of the image, then the problem would present
itself. The resulting swf would display an image with a black border two
pixels thick on the left and top, and no border on the bottom and right.

I have included the original attachments again (zipped up this time) so you
can have a better look. I used a border that changed from black to yellow so
I could establish if the pixels were being duplicated or if the image was
being corrupted and the last row/column were being shown as the first
row/column. The png was created using the GIMP.

Hope this makes more sense.

Cheers,

Mick




Chris Pugh wrote:

Mick,

Yes it is the blank stage.  The one conversion is an image inside an
swf, the other is an swf in its pwn right.

I also tried your png image again, doing the conversion and setting
the html code myself, a your original post to the list did not include
all the attachments you mentioned.  I do see a slight variation on the
render, however think it is a result of the png itself,  which looks
weird, even when opened in GIMP.  What was it created with?

I created a similar, but slightly smaller rectangular png myself, and
all seems to work fine with it.  Its attached.  Substitute it for your
own version, repeat the process you used before, probably much as
below, then see what happens.

.flash filename="test_swfc.swf" version=6 fps=50 bbox=435x122
 .png img1 filename="test2.png"
 .put img1
.end

then,

   png2swf test2.png -o test_png2swf.swf

   swfdump -E test_png2swf.swf > test_png2swf.html

   swfdump -E test_swfc.swf > test_swfc.html


Regards,


Chris.

On 07/03/2010, Mick <address@hidden> wrote:
Hi Chris,

 Have just tried compiling the script you suggested with swfc. All I get
is
a black rectangle measuring 435x122 pixels. I'm assuming this is the blank
stage. Not sure how this explains my problem. Any chance you can
elaborate?

 Cheers,
 Mick




reply via email to

[Prev in Thread] Current Thread [Next in Thread]