我使用 Flash Media Event 在我的游戏中实现了相机胶卷。现在,我想要裁剪功能。一旦我从我的画廊拍摄照片,如何在将其上传到我的游戏之前进行裁剪,例如在 Android 手机上的 black berry messenger dp 上进行裁剪?我正在使用 starling、AIR、flash 和 as3 代码。
问问题
379 次
1 回答
0
问题与八哥无关。使用谷歌你可以找到很多裁剪技术,例如这个http://shaun.boyblack.co.za/blog/2008/08/29/image-resizing-and-cropping-utility/和这个http:// blog.soulwire.co.uk/code/actionscript-3/fit-a-displayobject-into-a-rectangle Starling显示对象和传统闪光灯没有太大区别。所以你的代码可能看起来像这样:
protected var myCam:CameraUI;
...
myCam = new CameraUI();
myCam.addEventListener(MediaEvent.COMPLETE, onComplete);
myCam.launch(MediaType.IMAGE);
...
protected function onComplete(e:MediaEvent):void
{
//getting the url to image file
var file:File = e.data.file;
trace(file.nativePath); //or
trace(file.url);
//then you can download image and crop it with any technic as simple bitmap
//then use it for Texture and show it in starling
//then upload it to server
}
于 2015-02-17T06:33:24.900 回答