My original post starting this thread stated that copyPixels() does not work when compositing _two_ images with alpha channels.
I haven't followed this thread since the start, so I might be out of synchro, but FYI here comes a little movie script I used intensively when compositing the 'creatures' for the main games of http://synchrobeat.swatch.com/
on CopyPix32 (imgDest, imgSrc, rDest, rSrc) -------------------------- -- -- INPUTS : inputs are organised like the 4 first inputs of the -- Lingo copyPixels command. For speed reason, no test is done to -- test wether the src and dest images are 32 bits (to extract and -- set alpha channels). This test is up to you! -- -- imgDest : <#imageObject> destination image -- imgSrc : <#imageObject> source image -- rDest : <#rect> destination rect -- rSrc : <#rect> source rect -- -- OUTPUT : nothing, the imgDest is directly modified -------
-- get the original alpha channel alphaBuffer = imgDest.extractAlpha()
-- copy the bitmap data copyPixels(imgDest, imgSrc, rDest, rSrc)
-- copy the alphachannel pixelmap alphatoAdd = imgSrc.extractAlpha() alphaBuffer.copyPixels(alphatoAdd, rDest, rSrc, [#ink:39])
-- apply the alpha changes imgDest.setAlpha(alphaBuffer)
end -- CopyPix32 handler
This might not be perfect, but it's quite fast (indeed here I don't do additional test on the bitdepths, and/or useAlpha, as I use it only when I want to composite 32bits-alphaEnabled image objects) and give satisfying results
I was compositing *lots* of images taken from32 bits images extracted from swf members used as 'graphic libraries' (so the memory requirements for all the sprites image tables where quite large, but this enabled us to have a near-infinite creature range with minimal animation, without a long download time nor a dead-slow framerate due to swf sprites overlay)
Does this helps? s�b [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
