相机胶卷具有as3 starling的裁剪功能

时间:2015-02-16 08:41:52

标签: actionscript-3 flash crop starling-framework camera-roll

我使用flash Media Event在我的游戏上实现了相机滚动。现在,我希望有裁剪功能。有一次我从我的画廊拍照,如何裁剪之前上传到我的游戏像在Android手机上的黑莓浆信使dp裁剪? 我正在使用starling,AIR,flash和as3代码。

1 个答案:

答案 0 :(得分: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

}