var show_mm:Mm=new Mm(0,0);
var show_bmp:Bitmap =new Bitmap(show_mm);
addChild(show_bmp);
var border_sprite:Sprite;
var copy_bmp:Bitmap =new Bitmap;
addChild(copy_bmp);
var left_point:Point =new Point;
var right_point:Point =new Point;
var start_point:Point =new Point;
function MouseDownHandler(_evt:MouseEvent):void {
root.border_sprite=new Sprite;
addChild(root.border_sprite);
start_point.x=stage.mouseX;
start_point.y=stage.mouseY;
stage.addEventListener(MouseEvent.MOUSE_MOVE ,MouseMoveHandler);
stage.addEventListener(MouseEvent.MOUSE_UP ,MouseUpHandler);
}
function MouseMoveHandler(_evt:MouseEvent):void {
right_point.x=Math.max (stage.mouseX,start_point.x);
right_point.y=Math.max (stage.mouseY,start_point.y);
left_point.x=Math.min (stage.mouseX,start_point.x);
left_point.y=Math.min (stage.mouseY,start_point.y);
border_sprite.graphics.clear();
border_sprite.graphics.lineStyle(1,0xff0000);
border_sprite.graphics.moveTo(left_point.x,left_point.y);
border_sprite.graphics.lineTo(right_point.x,left_point.y);
border_sprite.graphics.lineTo(right_point.x,right_point.y);
root.border_sprite.graphics.lineTo(left_point.x,right_point.y);
root.border_sprite.graphics.lineTo(left_point.x,left_point.y);
}
function MouseUpHandler(_evt:MouseEvent):void {
root.border_sprite.graphics.clear();
var _bmd:BitmapData =new BitmapData(stage.width,stage.height);
_bmd.draw(stage);
var _rectangle:Rectangle =new Rectangle(left_point.x,left_point.y,right_point.x-left_point.x,right_point.y-left_point.y);
var new_bmd:BitmapData =new BitmapData(right_point.x-left_point.x,right_point.y-left_point.y);
new_bmd.copyPixels(_bmd,_rectangle,new Point(0,0));
copy_bmp.bitmapData =new_bmd;
stage.removeEventListener(MouseEvent.MOUSE_MOVE ,MouseMoveHandler);
stage.removeEventListener(MouseEvent.MOUSE_UP ,MouseUpHandler);
}
stage.addEventListener(MouseEvent.MOUSE_DOWN ,MouseDownHandler);
我的博物馆故事 官方安卓版v1.61.2
我的博物馆故事是一款以消除为主题的经营养成类手游,在这里玩家
专业模拟飞行10 手机版v12.2.4
专业模拟飞行10安卓版是一款飞行休闲手游,顶尖的物理飞行引擎
动物起义战斗模拟器二琳同款 最新版v4.1.1
动物起义战斗模拟器是一个非常有趣的模拟类游戏,玩家可以召唤各
迷你世界七周年 安卓手机版v1.43.0
迷你世界7周年是一款由《迷你世界》官方推出的庆祝特别版本,在
劫后公司无限资源版 v1.0.5.1
劫后公司内置菜单版是游戏的破解版本,在该版本中为玩家提供了内