Hi there
I want to get an image and then perhaps cache it on a IndexDB for later use as a base64 image. I understand there are some .get methods.
For this example..
Will it suffice if I just use BANano.GetFileAsDataURL?
Thanks in advance.
Update: BANano.GetFileAsDataURL is the key.
I want to get an image and then perhaps cache it on a IndexDB for later use as a base64 image. I understand there are some .get methods.
For this example..
B4X:
const imageUrl = "https://i.picsum.photos/id/566/200/300.jpg?hmac=gDpaVMLNupk7AufUDLFHttohsJ9-C17P7L-QKsVgUQU";
(async () => {
const response = await fetch(imageUrl)
const imageBlob = await response.blob()
const reader = new FileReader();
reader.readAsDataURL(imageBlob);
reader.onloadend = () => {
const base64data = reader.result;
console.log(base64data);
}
})()
Will it suffice if I just use BANano.GetFileAsDataURL?
Thanks in advance.
Update: BANano.GetFileAsDataURL is the key.
Last edited: