examples/phonegap1/plugins/cordova-plugin-media-capture/src/windows/CaptureProxy.js
function () {
                        var encodingProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createJpeg(),
                            overwriteCollisionOption = Windows.Storage.CreationCollisionOption.replaceExisting,
                            tempFolder = Windows.Storage.ApplicationData.current.temporaryFolder;

                        tempFolder.createFileAsync("cameraCaptureImage.jpg", overwriteCollisionOption).done(function (capturedFile) {
                            capture.capturePhotoToStorageFileAsync(encodingProperties, capturedFile).done(function () {
                                // store intermediate result in object's global variable
                                capturedPictureFile = capturedFile;
                                // show pre-captured image and toggle visibility of all buttons
                                previewContainer.style.backgroundImage = 'url("' + 'ms-appdata:///temp/' + capturedFile.name + '")';
                                toggleElements('capturePreview', 'takePicture', 'cancelCapture', 'selectPicture', 'retakePicture');
                            }, function (err) {
                                destroyCameraPreview();
                                errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
                            });
                        }, function (err) {
                            destroyCameraPreview();
                            errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
                        });
                    }
function () {
                        var encodingProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createJpeg(),
                            overwriteCollisionOption = Windows.Storage.CreationCollisionOption.replaceExisting,
                            tempFolder = Windows.Storage.ApplicationData.current.temporaryFolder;

                        tempFolder.createFileAsync("cameraCaptureImage.jpg", overwriteCollisionOption).done(function (capturedFile) {
                            capture.capturePhotoToStorageFileAsync(encodingProperties, capturedFile).done(function () {
                                // store intermediate result in object's global variable
                                capturedPictureFile = capturedFile;
                                // show pre-captured image and toggle visibility of all buttons
                                previewContainer.style.backgroundImage = 'url("' + 'ms-appdata:///temp/' + capturedFile.name + '")';
                                toggleElements('capturePreview', 'takePicture', 'cancelCapture', 'selectPicture', 'retakePicture');
                            }, function (err) {
                                destroyCameraPreview();
                                errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
                            });
                        }, function (err) {
                            destroyCameraPreview();
                            errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
                        });
                    }
function ( ) { var encodingProperties = Windows . Media . MediaProperties . ImageEncodingProperties . createJpeg ( ) , overwriteCollisionOption = Windows . Storage . CreationCollisionOption . replaceExisting , tempFolder = Windows . Storage . ApplicationData . current . temporaryFolder ; tempFolder . createFileAsync ( "cameraCaptureImage.jpg" , overwriteCollisionOption ) . done ( function ( capturedFile ) { capture . capturePhotoToStorageFileAsync ( encodingProperties , capturedFile ) . done ( function ( ) { // store intermediate result in object's global variable capturedPictureFile = capturedFile ; // show pre-captured image and toggle visibility of all buttons previewContainer . style . backgroundImage = 'url("' + 'ms-appdata:///temp/' + capturedFile . name + '")' ; toggleElements ( 'capturePreview' , 'takePicture' , 'cancelCapture' , 'selectPicture' , 'retakePicture' ) ; } , function ( err ) { destroyCameraPreview ( ) ; errorCallback ( CaptureError . CAPTURE_INTERNAL_ERR , err ) ; } ) ; } , function ( err ) { destroyCameraPreview ( ) ; errorCallback ( CaptureError . CAPTURE_INTERNAL_ERR , err ) ; } ) ; }
Callback for Take button - captures intermediate image file.
Callback for Take button - captures intermediate image file .