Allows adding images to- and fetching images from the system image gallery.

Fuse represents images as frozen JavaScript Image objects, consisting of a path, a filename, a width and a height. Once created or acquired, Images can be passed around to other APIs to use, fetch or alter their underlying data. All images are temporary "scratch images" until storage has been specified either through publishing to the CameraRoll or other.

Using this API on Android will request the WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE permissions.

Note: You need to add a package reference to Fuse.CameraRoll to use this API.

Examples

Requesting an image from the camera roll:

var cameraRoll = require("FuseJS/CameraRoll");

cameraRoll.getImage()
    .then(function(image) {
        // Will be called if the user successfully selected an image.
    }, function(error) {
        // Will be called if the user aborted the selection or if an error occurred.
    });

Taking a picture with the camera and adding it to the camera roll:

var cameraRoll = require("FuseJS/CameraRoll");
var camera = require("FuseJS/Camera");

camera.takePicture(640, 480)
    .then(function(image) {
        return cameraRoll.publishImage(image);
    })
    .then(function() {
        // Will be called if the image was successfully added to the camera roll.
    }, function(error) {
        // Will called if an error occurred.
    });

Note: You also need to add a package reference to Fuse.Camera for the above example to work.

Location

Namespace
Fuse.CameraRoll
Package
Fuse.CameraRoll 1.8.0-rc2

Interface of CameraRoll

getImage() js

Starts an OS-specific image picker view (user-configurable on Android).

Inherited from NativeModule

Inherited from Module

GetFile : FileSource uno

Returns the file source that will be watched by the Context for changes in Fuse preview. Override in subclasses and return correct file source to support live updates in Fuse preview.

Inherited from object

Attached UX Attributes

GlobalKey (attached by Resource) : string ux

The ux:Global attribute creates a global resource that is accessible everywhere in UX markup.

Implemented Interfaces