Utility methods for common Image manipulation.

To use this module, add Fuse.ImageTools to your package references in your .unoproj.

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.

On Android using this API will request the WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE permissions.

Example

<JavaScript>
    var ImageTools = require("FuseJS/ImageTools");
    var Observable = require("FuseJS/Observable");

    var imagePath = Observable();
    var base64Image =    "iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPAQMAAAABGAcJAAAABlBMVEX9//wAAQATpOzaAAAAH0l" +
                        "EQVQI12MAAoMHIFLAAYSEwIiJgYGZASrI38AAAwBamgM5VF7xgwAAAABJRU5ErkJggg==";
    ImageTools.getImageFromBase64(base64Image)
    .then(function(image) {
        imagePath.value = image.path;
    });

    module.exports = { test: new Date().toString(), image: imagePath };
</JavaScript>
<Image File="{image}" />

Location

Namespace
Fuse.ImageTools
Package
Fuse.ImageTools 1.9.0

Interface of ImageTools

resize(image, options) js

Resizes an image using the options provided, and returns a Promise of the transformed Image.

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