/*****进行消锯齿与不消锯齿的对比*****/
import
flash.display.BitmapData;
/*************加载******************/
var container1:MovieClip = createEmptyMovieClip("container1", getNextHighestDepth());
var container2:MovieClip = createEmptyMovieClip("container2", getNextHighestDepth());
var loader1:MovieClipLoader = new MovieClipLoader();
var loader2:MovieClipLoader = new MovieClipLoader();
var obj:Object = new Object();
obj.onLoadInit = function(target:MovieClip) {
trace("onLoadInit");
loaderDispose(target);
};
loader1.addListener(obj);
loader1.loadClip("1.jpg", container1);
loader2.addListener(obj);
loader2.loadClip("1.jpg", container2);
/**********图片处理***************/
var bitmapLoader1:MovieClip = createEmptyMovieClip("Bloader1", getNextHighestDepth());
var bitmapLoader2:MovieClip = createEmptyMovieClip("Bloader2", getNextHighestDepth());
var bitmap1:BitmapData;
var bitmap2:BitmapData;
function loaderDispose(mc:MovieClip) {
mc._visible = false;
/*******不平滑*******/
if (mc._name == "container1") {
bitmap1 = new BitmapData(mc._width, mc._height, true, 0x00FFFFFF);
bitmap1.draw(mc);
bitmapLoader1.attachBitmap(bitmap1, 0);
bitmapLoader1._x = -50;
bitmapLoader1._xscale = bitmapLoader1._yscale=250;
} else {
/******平滑处理*******/
bitmap2 = new BitmapData(mc._width, mc._height, true, 0x00FFFFFF);
bitmap2.draw(mc);
bitmapLoader2.attachBitmap(bitmap2, 1, "auto", true);
//主要就是这个smooth参数,true表示平滑
bitmapLoader1._x = -50;
bitmapLoader2._y = 300;
bitmapLoader2._xscale = bitmapLoader2._yscale=250;
}
}