Android:来自存储在数据库中的 URI 的图像缩略图库
我的应用程序允许用户启动相机意图拍照以与人和证据相关联。我想将 URI 存储在查找表中(例如:PersonMedia)并将相关图片的缩略图加载到图库视图中;随后允许用户从缩略图中查看完整图像。我找到的每个示例都演示了从 SD 卡完整内容加载缩略图,而不是从特定 URI 加载缩略图。
我的第二个选择是将字节数组存储在 SQLLite 中,但我不太喜欢这样做。任何帮助将不胜感激。
顺便说一句,过去我不知道如何对正确答案进行投票。我终于明白了!是的,我也有我的时刻……哈哈。
My application allows it's user to start a camera intent to take pictures to associate with people and evidence. I want to store the URI in a lookup table (ex: PersonMedia) and load thumbnails of the associated pictures into a gallery view; subsequently allowing the user to view the full image from the thumbnail. Every example I find demonstrates loading thumbnails from the SD Cards full contents but not from specific URI's.
My second choice being to store the byte array in SQLLite, but I'm not a big fan of that. Any help would be greatly appreciated.
As a side note, in the past I couldn't figure out how to vote on the correct answer. I finally got it! Yeah, I have my moments...lol.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过提供动态目录路径直接从 SD 卡加载图像解决了这个问题。通过将 URI 存储在数据库中来调用图像并没有按照我预期的方式工作。如果有人想做同样类型的事情,这里是代码。
私有布尔LoadImageFiles() {
I solved this by loading images directly from the sd card by providing a dynamic directory path. Recalling the images by storing the URI's in the database didn't work the way I expected it to. Here is the code if anyone wants to do the same type thing.
private boolean LoadImageFiles() {