private function copyMove(event:MouseEvent):void
{
var msx:Number = mouseX;
var msy:Number = mouseY;
for(var x:Number=(msx-10);x<(msx+10);x++)
{
for(var y:Number=(msy-10);y<(msy+10);y++)
{
if(Point.distance(new Point(msx,msy),new Point(x,y))<=10)
{
//变透明
// var color:Number = bmd.getPixel32(x,y);
// var ncolor:Number = color&0x00FFFFFF;
// bmd.setPixel32(x,y,ncolor);
//彩色变黑白
var color:Number = bmd.getPixel(x,y);
var R:Number = (color>>16) & (0xFF);
var gray:Number = R + (R<<8)+(R<<16);
bmd.setPixel(x,y,gray);
}
}
}
}
as3 图片变色,橡皮擦工具 源代码
最新推荐文章于 2018-08-06 15:33:00 发布