简体   繁体   中英

insert base64 encoded image into AR.ImageResource in Wikitude SDK for iOS

Im looking to insert a base64 encoded image when creating a new AR.ImageResource in Wikitude SDK iOS.

I can do this directly in HTML img src attribute using javascript as follows

 document.getElementById("imageFooterId").src = "data:image/png;base64," + jsonObject[id].picData;

But to render images in the aug view of Wikitude it is required to use the AR.ImageResource and it is a little more difficult to insert a base64 encode image.

I am using the following function call with no luck

 tmpImage = new AR.ImageResource("data:image/png;base64," + jsonObject[i].picData, {onError: errorLoadingImage});

Are they any suggestions out there for performing this action?

this is currently not supported. I could imagine using a webservice that generates an URL from a base64 image which you can use for the AR.ImageResource. But you would still have to send/load it over the interwebs which is not optimal.

also look at: http://forum.wikitude.com/home/-/message_boards/message/28074

Disclaimer: I work for the company.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM