I started to eat a cup, but it really didn't taste so good. Suddenly, my
mouth really hurt trying to voraciously chew on ceramics, thus I gave up
upon realising cups don't taste so good.
...however, this code in fact works:
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Matrix;
import flash.geom.ColorTransform;
function init()
{
Stage.align = "TL";
Stage.scaleMode = "noScale";
createEmptyMovieClip("image_mc", 0);
var mcl:MovieClipLoader = new MovieClipLoader();
mcl.addListener(this);
mcl.loadClip("test.jpg", image_mc);
}
function onLoadInit(target)
{
var width:Number = image_mc._width;
var height:Number = image_mc._height;
var transparent:Boolean = false;
var fillColor:Number = 0xFFFFFFFF;
var myBitmapData:BitmapData = new BitmapData(width, height, transparent,
fillColor);
myBitmapData.draw(image_mc, new Matrix(), new ColorTransform());
createEmptyMovieClip("copy_mc", 1);
copy_mc._x = 20;
copy_mc._y = 20;
copy_mc.attachBitmap(myBitmapData, 0);
image_mc._alpha = 20;
}
init()
----- Original Message -----
From: "Marcelo Volmaro" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <[email protected]>
Sent: Monday, March 06, 2006 5:38 PM
Subject: Re: [Flashcoders] Load external bitmap into bitmapdata?
The problem is: I need to load a bitmap. I can´t embed the bitmap inside a
swf, because i have no control over the bitmaps.
Any other ideas?
On Mon, 06 Mar 2006 17:36:46 -0300, Adrian Park <[EMAIL PROTECTED]> wrote:
> Hey Marcelo,
>
> I've been playing with BitmapData for the first time this past weekend
> so I
> stand to be corrected on what I'm about to say!
>
> My understanding is that you can only load BitmapData from an existing
> image
> which is already in your library and has a linkage ID. For this reason, I
> don't think you can load an image and get its BitmapData. I was thinking
> there might be a workaround though...
>
> I was going to try embedding the jpg/png/gif in an swf and giving it a
> linkage id in the library, then load that swf into your master movie and
> attach the BitmapData from the loaded swf's library.
>
> Possible issues? I know you can't attach library assets from a loaded swf
> into another swf so the same limitation may apply with BitmapData.
> Again, I
> thought a workaround for this might be to attach the BitmapData into the
> swf
> you've just loaded and then clone it to a BitmapData object elsewhere?
>
> As you can see, I've been doing a lot of thinking and not a lot of doing
> so
> I'm not sure if this is of any help at all!
>
> I'd be very interested to know if any of this works.
>
> Cheers, Adrian P
>
> On 3/6/06, Marcelo Volmaro <[EMAIL PROTECTED]> wrote:
>>
>> Hi list!,
>>
>> It´s possible to load an external bitmap (jpg, png, gif) into a
>> bitmapData?
>>
>> Or..
>>
>> It´s possible to load an external bitmap into an MC and then render that
>> mc into a bitmapData?
>>
>> All what i tried didn´t work...
>>
>> Thanks in advance!,
>>
>>
>> --
>> _____________
>> Marcelo Volmaro
>> _______________________________________________
>> [email protected]
>> 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
>>
> _______________________________________________
> [email protected]
> 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
--
_____________
Marcelo Volmaro
_______________________________________________
[email protected]
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
_______________________________________________
[email protected]
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