Brian,

Yes!  That works!

Wouldn't you think that would be the default, if one doesn't specify the fillColor at all?

(And, DOH! I was reversing the alpha values in my mind, and specifying FF as fully transparent!)


Thanks,
--Dave




did you try filling with 0?  You're setting the background color to an
opaque color, and then drawing the transparent bitmap on top of it.

var m_cBitmap = new BitmapData( target_mc._width, target_mc._height,
true, 0x0 );

if you don't specify the color, it might be using 0xff000000 (black with an
alpha of 255).

--Brian

On 5/8/07, David Cohn <[EMAIL PROTECTED]> wrote:

Hey all,

I must be missing something straight-forward here...

I'm loading a PNG file with a transparent background, and then I want
to extract the Bitmap, preserving its transparency.  The loaded clip
shows up with the transparent background, but after the .draw(), the
bitmap seems to lose its transparency.  (the trace statement, of
course, shows the .transparent property to be true)

Can anyone spot the error?

Thanks,
--Dave


loaderObj.onLoadInit = function( target_mc:MovieClip ) {

        // tried with and without setting fillColor
        var m_cBitmap = new BitmapData( target_mc._width,
target_mc._height,
true, 0xFF990000 );

// tried with and without setting pMatrix, pColorTransform, and
various blendModes
        var pMatrix = new Matrix();
        var pColorTransform = new ColorTransform();
m_cBitmap.draw( target_mc, pMatrix, pColorTransform, "normal" );

var bitmap_mc = _root.createEmptyMovieClip ( "transparency_test",
_root.getNextHighestDepth() );
        bitmap_mc.attachBitmap(m_cBitmap, 2, "auto", true);

        trace("onLoadInit: transparency="+m_cBitmap.transparent);
};





_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to