code: 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);
                          });
                      }
docs: Callback for Take button - captures intermediate image file.