|
Flash8位图旋转后消除锯齿的办法 |
http://www.xxqqss.com 学习轻松网 点击量:5866
|
|
|
Flash8中的位图如果旋转的话,会有锯齿,如果图片已经在库中,解决方法是双击库中的图片进入属性面板,勾选“允许平滑”。如果是外部导入图片,可以用下面的方法解决,此方法来源于网络,原始出处不详:
_global.smoothImageLoad = function(imgURL, targetMovie) { var i=0 do { i++ } while (eval("_root.smoothImageLoadTemp"+i) != undefined) tmc = _root.createEmptyMovieClip("smoothImageLoadTemp"+i, _root.getNextHighestDepth()) tmc.createEmptyMovieClip("ti", tmc.getNextHighestDepth()) tmc.tm = targetMovie with(tmc) { tmcl = new MovieClipLoader() tmcl.onLoadComplete = function() { ti.onEnterFrame = function() { pixelData = new flash.display.BitmapData(ti._width, ti._height); pixelData.draw(ti); tm.attachBitmap(pixelData, 1, true, true); tm.smoothImageLoadComplete() removeMovieClip(ti._parent) } } tmcl.loadClip(imgURL, tmc.ti) } } smoothImageLoad("xxx.jpg", mymc);
作者:朱高 来源:zhugao.cn
|
|
|
|
|