Marcelo.
Marcelo, I do not have much time, so here's a copy paste of my code on onLoadInit:
var bitmap:BitmapData = new BitmapData(foto_holder.img._width, foto_holder.img._height, true);
bitmap.draw(foto_holder.img);
foto_holder.img.removeMovieClip();
foto_holder.img.unloadMovie();
foto_holder.img=foto_holder.createEmptyMovieClip("img", foto_holder.getNextHighestDepth());
foto_holder.img.attachBitmap(bitmap, foto_holder.img.getNextHighestDepth(),"auto", true);
Hope it works for you. Try replacing the null for the nextHighestDepth. And check if the loaded image is available when you run the code: do a trace("image width: " + loaded_img._width), and check if width is not zero.
João Saleiro
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Marcelo de Moraes Serpa
Sent: quarta-feira, 21 de Junho de 2006 13:36
To: [email protected]
Subject: [osflash] Using Bitmap data to smooth a image help
I have a image loader component which uses the mm loader component to load it´s image. This widget is rotated and scaled, so the image loaded in it gets "pixelated". I was told that (thanks for the tip João Saleiro) I could use the BitmapData class to make a copy of the loader movieclip and attach it again with the smooth flag on. However, I couldn´t get it to work with the loader component, I´ve put the following code at the complete event of the Loader component:
loader_list.complete = Delegate.create(this,function() {
var bd:BitmapData = new BitmapData(ldr._width,ldr._height,true,1);
bd.draw(ldr.contentHolder);
ldr._visible = false;
this.attachBitmap(bd,null,1);
});
ldr.addEventListener('complete',loader_list);
This code is triggered but it doesn´t copy the loader loaded image (ldr.contentHolder. I´ve also tried ldr and ldr.content ) in the draw() method... maybe becouse at this point it isn´t completely avaiable? Maybe I should use MovieClipLoader and call this code on the onLoadInit event?
Marcelo.
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org
_______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
