最新下载
热门教程
- 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)
相关文章
- 《彩色点点战争》推图常用三大主c玩法详解 01-23
- 《燕云十六声》池鱼林木任务攻略 01-23
- 《大连地铁e出行》查看行程记录方法 01-23
- 《明日方舟》2025春节限定干员余角色介绍 01-23
- 《崩坏:星穹铁道》万敌光锥搭配攻略 01-23
- 《燕云十六声》一药千金任务攻略 01-23