简体   繁体   English

如何在Phonegap中使用图像路径而不是base64字符串?

[英]How to use image path instead of base64 string in phonegap?

I have application with HTML5 & phonegap & iphone native plugins. 我有HTML5,phonegap和iPhone本机插件的应用程序。

Image uploaded & stored on iphone's local storage using native plugin. 使用本机插件将图像上传并存储在iPhone的本地存储中。 Then they are providing base 64 image string & we are displying in HTML img tage. 然后,他们将提供基本的64位图像字符串,并且将显示在HTML图像中。

So if there are more than 10 images then they have 10 base64 image string. 因此,如果图像多于10个,则它们具有10个base64图像字符串。 So it's taking too much time to load the page. 因此,加载页面花费了太多时间。

Can we manage like this they will provide sdcard image path & we display in HTML image tag? 我们可以这样管理,他们将提供sdcard图像路径并以HTML图像标签显示吗?

We tried but didn't succeeded. 我们尝试了但没有成功。

Take a look at FileTransfer . 看一下FileTransfer You can use it to download files to mobile phone file storage, after download just save path and set src attribute of img. 您可以使用它将文件下载到手机文件存储中,下载后只需保存路径并设置img的src属性即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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