Hi Sébastien,

I had to add two lines to get reasonable results:

>
>    -- get the original alpha channel
>    alphaBuffer = imgDest.extractAlpha()

imgDest.useAlpha = FALSE

>
>
>    -- 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)

imgDest.useAlpha = TRUE

>
>
> end -- CopyPix32 handler

Without those changes, the background had the right alpha, but with color taken from 
the top image. With these changes, it's much better, but any partially transparent 
pixels in imgSrc become white (the more transparent, the more white they become). So 
in the example I posted
before (which I have reposted using your code), the drop shadow of the top text 
becomes white, instead of black.  Many composites won't have large transparent 
sections in the top image, so it wouldn't always be a problem.

I tried many variations on inks and masks with copypixels in my testing before writing 
the pixel by pixel method, including isolating the masks and using darken ink.  None 
of them produced a proper composite.  As you imply, the method to use depends on the 
desired results.

Thanks!

Daniel

[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!]

Reply via email to