hrugani
hrugani

Reputation: 477

How to make images in local Storage visible in (CodeNameOne) WebComponent?

In my App I downloaded several images using this code:

boolean bResp = Util.downloadUrlToStorage( url, "IwImage_" + idImage + ".png", true );

This works ok.

Now , I need to make these images visible inside webComponent.

How do I write IMG TAG that points to those images?

How can I figure out the url that points to these local image files in my device?

Upvotes: 2

Views: 63

Answers (1)

Shai Almog
Shai Almog

Reputation: 52770

Storage is invisible to the web UI as they reside in separate spaces. However, you can use data URI to insert arbitrary images into HTML.

You can use the WebBrowser.createDataURI(byte[],String) method to generate a URI that you can embed in an <img> tag without a problem.

Upvotes: 0

Related Questions