最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
用AS把位图切割成三角形
时间:2022-07-02 17:22:22 编辑:袖梨 来源:一聚教程网
(方格)回答:用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)
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)
相关文章
- 《无限暖暖》天星之羽获得位置介绍 12-20
- 《流放之路2》重铸台解锁方法介绍 12-20
- 《无限暖暖》瞄准那个亮亮的成就怎么做 12-20
- 《无限暖暖》魔气怪终结者完成方法 12-20
- 《无限暖暖》曙光毛团获得位置介绍 12-20
- 《无限暖暖》日光果获得位置介绍 12-20