getImageFromBase64 sample please

Some example of using Img Tools to display image based 64 with getImageFromBase64

Thanks for your help

I haven’t tested this but I think I may have an idea of how it works:

var file = Observable('Assets/Image.png');
var data = // let's say this is your base64 code, idk how you're getting it but you somehow got it either from fetch or whatever

module.exports = {
    file: file,
    click: function() {
        ImageTools.getImageFromBase64(data).then(function(base64Image) {
            file.value = base64Image;
    <Image File="{file}" />
    <Button Text="Get Pic" Clicked="{click}" />

Let me know if that works please

What are you trying to do? You are not supposed to display images with ImageTools.

I try to display a base64 image obtained from an RESTful API, any idea how to do it?


getImageFromBase64 returns a promise of an image object. One of the fields on the image object is “path”.

    function(image) { 
        //Display image using image.path here, for instance by binding to UX Image File attribute