[osflash] Paul Neave's WaterEffect class working with transparencies
João Saleiro
joao.saleiro at webfuel.pt
Thu Jul 31 03:28:06 PDT 2008
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,
João Saleiro
Chief Technology Officer
Tlm 1: +351 916 077 097 Skype: joao.saleiro
Tlm 2: +351 968 203 370 Email/MSN: joao.saleiro at webfuel.pt
<mailto:joao.saleiro at webfuel.pt>
www.webfuel.pt <http://www.webfuel.pt>
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,
>> --
>> João Saleiro
>> Chief Technology Officer
>>
>>
>> Tlm 1: +351 916 077 097 Skype: joao.saleiro
>> Tlm 2: +351 968 203 370 Email/MSN: joao.saleiro at webfuel.pt
>> <mailto:joao.saleiro at webfuel.pt>
>>
>>
>>
>> www.webfuel.pt <http://www.webfuel.pt>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> osflash mailing list
>> osflash at osflash.org
>> http://osflash.org/mailman/listinfo/osflash_osflash.org
>>
> ------------------------------------------------------------------------
>
> _______________________________________________
> osflash mailing list
> osflash at osflash.org
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/osflash_osflash.org/attachments/20080731/77cdb012/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: esq.gif
Type: image/gif
Size: 7584 bytes
Desc: not available
Url : http://osflash.org/pipermail/osflash_osflash.org/attachments/20080731/77cdb012/attachment-0012.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dir_cima.gif
Type: image/gif
Size: 195 bytes
Desc: not available
Url : http://osflash.org/pipermail/osflash_osflash.org/attachments/20080731/77cdb012/attachment-0013.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dir_cima_canto.gif
Type: image/gif
Size: 197 bytes
Desc: not available
Url : http://osflash.org/pipermail/osflash_osflash.org/attachments/20080731/77cdb012/attachment-0014.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dir_meio_canto.gif
Type: image/gif
Size: 114 bytes
Desc: not available
Url : http://osflash.org/pipermail/osflash_osflash.org/attachments/20080731/77cdb012/attachment-0015.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dir_baixo.gif
Type: image/gif
Size: 1023 bytes
Desc: not available
Url : http://osflash.org/pipermail/osflash_osflash.org/attachments/20080731/77cdb012/attachment-0016.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dir_baixo_canto.gif
Type: image/gif
Size: 648 bytes
Desc: not available
Url : http://osflash.org/pipermail/osflash_osflash.org/attachments/20080731/77cdb012/attachment-0017.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 7584 bytes
Desc: not available
Url : http://osflash.org/pipermail/osflash_osflash.org/attachments/20080731/77cdb012/attachment-0018.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 195 bytes
Desc: not available
Url : http://osflash.org/pipermail/osflash_osflash.org/attachments/20080731/77cdb012/attachment-0019.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 197 bytes
Desc: not available
Url : http://osflash.org/pipermail/osflash_osflash.org/attachments/20080731/77cdb012/attachment-0020.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 114 bytes
Desc: not available
Url : http://osflash.org/pipermail/osflash_osflash.org/attachments/20080731/77cdb012/attachment-0021.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 1023 bytes
Desc: not available
Url : http://osflash.org/pipermail/osflash_osflash.org/attachments/20080731/77cdb012/attachment-0022.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 648 bytes
Desc: not available
Url : http://osflash.org/pipermail/osflash_osflash.org/attachments/20080731/77cdb012/attachment-0023.gif
More information about the osflash
mailing list