Some example of using Img Tools to display image based 64 with getImageFromBase64
Thanks for your help
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:
<JavaScript>
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;
});
}
}
</JavaScript>
<Panel>
<Image File="{file}" />
<Button Text="Get Pic" Clicked="{click}" />
</Panel>
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?
Hey
getImageFromBase64
returns a promise of an image object. One of the fields on the image object is “path”.
ImageTools.getImageFromBase64(base64String).then(
function(image) {
//Display image using image.path here, for instance by binding to UX Image File attribute
}
)