The smoothing = true works!
Thank you for your suggestion :)
I'm posting the code anyway perhaps it's useful for anyone who has the same
problem.
package{
import flash.display.*;
import flash.events.*;
import flash.net.URLRequest;
public class Main extends MovieClip{
private var _assetLoader: Loader;
public function Main(){
init();
}
private function init(){
loadAsset("printable.swf");
}
private function loadAsset(src: String):void{
_assetLoader= new Loader();
_assetLoader.contentLoaderInfo.addEventListener(Event.INIT,doneLoadListener);
_assetLoader.load(new URLRequest(src) );
}
private function doneLoadListener( e:Event): void{
var assetW:Number= _assetLoader.content.width;
var assetH:Number= _assetLoader.content.height;
var bitmapData:BitmapData= new BitmapData(assetW/ 2,assetH/
2,false,0xFF0000);
bitmapData.draw(_assetLoader);
var bitmapImage: Bitmap= new Bitmap(bitmapData) ;
bitmapImage.smoothing = true;
ctnMc.addChild( bitmapImage) ;
}
}
}
Jim Hayes <[EMAIL PROTECTED]> wrote: You might
try setting smoothing = true on the bitmap?
I can't tell you if it will help offhand, but it's worth a go!
-----Original Message-----
From: [email protected] on behalf of Yochikoh Haruomi
Sent: Sat 02/02/2008 21:43
To: [email protected]
Subject: [flexcoders] BitmapData- the quality of image degrades when rotating
bitmapImage
Dear list,
Is there a way to rotate a Bitmap without having
quality degraded? ( or least degraded)
I load an external image and crop a part of the image
(using bitmap data) to display in a container. From
the design, the container needs to be rotated .
Whether I rotate the container or add the cropped
bitmapImage in the rotated container. The quality does
degrade dramatically .
Is there a solution for this? Any suggestion is
appreciated!
------
var _assetLoader:Loader;
loadAsset("printable.swf");
function loadAsset(src:String):void{
_assetLoader= new Loader();
_assetLoader.contentLoaderInfo.addEventListener(Event.INIT,doneLoadListener);
_assetLoader.load(new URLRequest(src));
}
function doneLoadListener(e:Event):void{
var assetW:Number=_assetLoader.content.width;
var assetH:Number=_assetLoader.content.height;
var bitmapData:BitmapData= new
BitmapData(assetW/2,assetH/2,false,0xFF0000);
var bitmapImage:Bitmap= new Bitmap(bitmapData);
bitmapData.draw(_assetLoader);
ctnMc.addChild(bitmapImage);
ctnMc.rotation=60;
}
Thanks,
Yoko
__________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
__________________________________________________________
This communication is from Primal Pictures Ltd., a company registered in
England and Wales with registration No. 02622298 and registered office: 4th
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT
registration No. 648874577.
This e-mail is confidential and may be privileged. It may be read, copied and
used only by the intended recipient. If you have received it in error, please
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637
1010. Please then delete the e-mail and do not disclose its contents to any
person.
This email has been scanned for Primal Pictures by the MessageLabs Email
Security System.
__________________________________________________________
---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.