来自网络的列表视图的图像缩略图
所以我有一个包含 10 行的列表视图,对于每一行,我必须从不同的 url 加载图像缩略图,有没有一种方法可以做到这一点,而无需下载所有 10 个大图像并调整它们的大小,我只需要这些图片的缩略图,下载所有图片将花费大量时间和内存,有什么想法吗? =\
非常感谢您的所有回答,好主意。
So i have a listview with 10 rows, for each row i have to load a image thumbnail from different url's, is there a way to do this with out downloading all 10 big images and resizing them, i just need the thumbnails from those pictures, and downloading all pictures will take a lot of time and memory, any ideas ? =\
Thanks a lot for all of your answers, great ideas.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您没有太多选择:
您的应用程序资源中有图像的本地副本
您需要加载图像,自行缩放缓存项目并在执行此操作时更新您的列表视图
为了减少流量和内存使用量,您可以预先缩放这些图片,提供除了原始图片之外的那些缩略图,并要求首先
(我不认为有类似的东西是免费的,但是那就太好了)使用 Web API 重新缩放图片并返回缩略图。这会减少流量,但可能不会减少请求时间。 (也许设置一个私人网络服务来为你做到这一点,也许是 php)
You have not much choices:
You have local copies of the images in your app resource
You need to load the images, scale them yourself cache tem and update your listview when you did that
To decrease amount of traffic and memory use you could prescale those pictures, provide those thumbnails besides the original picture, and request that first
(I don't think that there is something like that for free, but would be great) Use a web API which rescales the picture and returns the thumbnails. This would reduce the traffic but probably not the request time. (Maybe setup a private web service which does that for you, maybe php)
1,您可以下载这些图像,然后从该位图创建缩略图,然后将其存储在SD卡saved_thumbs中
2,在服务器端,您可以使用php创建缩略图,然后下载该图像
1, u can download those images then create a thumbnail from that bitmaps, then store it in SD card saved_thumbs
2, on the server side u can create the thumbs with php, then download that images
您需要执行以下操作:
这些是您需要采取的步骤。
如果您有任何疑问或问题,请告诉我。
Here's what you need to do:
These are the steps you need to take.
Let me know if you have any questions or problems.