问题:请问有用AS方法,把位图切割成三角形吗???不用遮罩的。
(方格)回答:用BitmapData()
import flash.display.BitmapData;
import flash.geom.Matrix;
this.createEmptyMovieClip("mShape",1);
this.createEmptyMovieClip("mBitmap",2);
mShape._x=100;
mShape._y=200;
var oListener:Object =new Object();
oListener.onLoadInit=function(mClip:MovieClip):Void{
var bmpImage:BitmapData =new BitmapData(mClip._width,mClip._height)
bmpImage.draw (mClip,new Matrix());
mClip._visible=false;
mShape.lineStyle(1);
mShape.beginBitmapFill(bmpImage,false,true,true);
//mShape.curveTo(100,-50,200,0);
mShape.lineTo(200,100);
mShape.lineTo(0,100);
mShape.lineTo(0,0);
mShape.endFill();
}
var mlBitmap:MovieClipLoader=new MovieClipLoader();
mlBitmap.addListener(oListener);
mlBitmap.loadClip("/UploadTeach/200707/20070730122301909.jpg",mBitmap)
进入论坛讨论学习:
http://space.flash8.net/bbs/thread-339207-1-2.html