Flash Builder 4.6捕获图像并保存在卡上

时间:2013-02-04 19:37:44

标签: flash flex mobile flash-builder

ve been looking above an hour for some tutorials without any luck. I need to store my capture image in application data folder for later purpose. I have my code for capture, but i don知道如何保存它。您可以帮助学习一些教程或任何代码示例。

IOS,Android,Flash builder 4.6

这是我的代码:

private function takePhotoHandler(e:Event):void {

if (CameraUI.isSupported){

        var cameraUI:CameraUI = new CameraUI();
        cameraUI.addEventListener(MediaEvent.COMPLETE, onCameraUIComplete);
        cameraUI.launch(MediaType.IMAGE);
    }
}


private function onCameraUIComplete(e:MediaEvent):void
{
    var cameraUI:CameraUI = e.target as CameraUI;
    cameraUI.removeEventListener(MediaEvent.COMPLETE, onCameraUIComplete);

    var mediaPromise:MediaPromise = e.data;

    this.mpLoader = new Loader();
    this.mpLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onMediaPromiseLoaded);
    this.mpLoader.loadFilePromise(mediaPromise);
}

private function onMediaPromiseLoaded(e:Event):void
{
    var mpLoaderInfo:LoaderInfo = e.target as LoaderInfo;
    mpLoaderInfo.removeEventListener(Event.COMPLETE, onMediaPromiseLoaded);
    snapshot.source = mpLoaderInfo.loader.content;
}

0 个答案:

没有答案