In the meantime, I was able to find out the solution of the problem.
The WaterEffect extends the AbstractEffect. On this class, the draw
method has a line:
targetBitmap.applyFilter(sourceBitmap, rect, point, displace);
I changed sourceBitmap to "source as BitmapData" and now it works
fine. The problem was that the effect was always using the previous
filtered image to generate the new one. This way, each new generated
"frame" is created by filtering the original image, and not the
previous frame.
Thanks,
henrik weber wrote:
cheers joao! :)
how do you create the BitmapData object from the png? i had some
similar issues with
transparent png's and solved them by using it this way:
new BitmapData(imgWidth_num, imgHeight_num, true, 0x00000000);
what did the trick in my case was setting the fillColor to
'0x00000000'... just a shot
in the dark though ;)
hth!
henrik
--
__digital spices__
Marketing & Communication
home: www.digitalspices.com
This electronic mail transmission contains confidential information
intended only for the person(s) named.
Any use, distribution, copying or disclosure by any other person is
strictly prohibited. If you have received it by mistake please let us
know by reply and then delete it from your system; you should not
copy it or disclose its contents to anyone.
João Saleiro wrote:
Hey,
I've been playing with Neave's WaterEffect class ( http://www.neave.com/webcam/api/com/neave/webcam/effects/displace/WaterEffect.html
) to animate a PNG element
with transparency. I had made a just a slight change - removed the blue
tint filter - and I have achieved the result available on http://www.webfuel.pt/jsaleiro/tests/TestElementoAnimado.html
.
On the top, there's the element being animated.
On the bottom, it's the original element.
As you can see, it seems the filter is destroying the alpha channel of
the PNG image. I've spent several hours messing with the code trying to
find a solution, but I was unable to find one.
Any suggestions that might help?
I am using Neave's class exactly like he uses it, but if you need the
source code just let me know.
Thanks in advance,
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org
|
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org