[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swftools-common] paletted-images and special swf-sizes?!
From: |
Matthias Kramm |
Subject: |
Re: [Swftools-common] paletted-images and special swf-sizes?! |
Date: |
Wed, 25 Feb 2004 12:19:33 +0100 |
User-agent: |
Mutt/1.4i |
On Tue, Feb 24, 2004 at 05:29:58PM +0100, Markus Schorer wrote:
> sometimes i get conversion errors (the line-offset of the pixel data
> seems to be shifted by 2 bytes).
> it does happen sometimes at the right border ( where width < 256).
> ...
> is there an known problem with "special-sized" images?
swf_SetBitsLossless() need each horizontal line of pixels to be aligned
at a four-byte boundary.
In the case of level1.swf, the image is 182 pixels wide, so you need to pad
each line
with two additional bytes (184%4==0).
There's also a macro, BYTES_PER_SCANLINE(x), which calculates the number
of bytes in the padded line.
So changing
doff += x+2;
to
doff += BYTES_PER_SCANLINE(x);
should do the trick.
Greetings
Matthias