FuseJS/ImageTools Module (JS)
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 2.9.1
Interface of ImageTools
getBufferFromImage(image) js
Crop(Image, int, int, int, int, bool) : Future<Image> uno
crop(image, options) js
ImageFromBase64(string) : Future<Image> uno
getImageFromBase64(base64) js
getImageFromBuffer(imageData) js
ImageFromByteArray(byte[]) : Image uno
ImageToBase64(Image) : Future<string> uno
ImageTools Constructor uno
Resize(Image, int, int, ResizeMode, bool) : Future<Image> uno
resize(image, options) js
Inherited from NativeModule
AddMember(NativeMember) uno
Reset : EventHandler (object, EventArgs) ux
Inherited from Module
Dispose uno
Evaluate(Context, ModuleResult) uno
Evaluate(Context, string) : ModuleResult uno
Evaluated : EventHandler (object, EventArgs) ux
EvaluateExports(Context, string) : object uno
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.