How to use images from the device in Firefox OS

╄→гoц情女王★ 提交于 2019-12-12 03:15:07

问题


In the application I'm building I want to show images from the device, but can't seem to figure out the proper way to do it. I'd like to let the user pick image, save the choice in localStorage and show it in img element.

I tried modifying Firefox OS Boilerplate App code for picking images, but it doesn't work because the blob changes everytime the app is opened. I have also read docs on Device Storage API but it doesn't mention referencing images in the app.


回答1:


It's hard to say any definitive answer based on the info you have provided - please share some code if you want us to be able to help you with your problem.

In the meantime, you might check out how I implemented this in my application - Check-in Fox, it should get you started. If you want to see the code in action, open the app and try opening any venue on the main screen (note: you will need to authenticate via Foursquare to be able to use this feature), then clicking on the Attach photo button.



来源:https://stackoverflow.com/questions/18168079/how-to-use-images-from-the-device-in-firefox-os

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!