安卓:最简单的做一个web视图显示位图的方法吗? [英] Android: Easiest way to make a WebView display a Bitmap?

查看:193
本文介绍了安卓:最简单的做一个web视图显示位图的方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的存储位图的变量远程源加载一些图片,我想显示它们。除了这些图像之间进行切换的用户也应该能够缩放和平移它们。我的第一个想法是通过一个意图内置的Gallery应用程序以某种方式通过他们,但这似乎并不可能。 该建议在几个地方的解决方案是使用的WebView,因为它已经支持缩放和平移。 我的问题是如何我的位图数据进入的WebView?我必须将它写入一个文件中的第一,我将不得不再次后删除,或是否有更简单的方法?

I have some images that I loaded from a remote source stored in Bitmap variables and I want to display them. In addition to switching between these images the user should also be able to zoom and pan them. My first idea was to somehow pass them via an intent to the built-in gallery application but this doesn't seem to be possible. A solution that is suggested in several places is using a WebView since it already supports zooming and panning. My question is how does my Bitmap data get into the WebView? Do I have to write it to a file first, which I would have to remove again later, or is there an easier way?

还是有更好的方法来完成我的主要目标,这是显示位图数据,缩放和panable图片?

Or are there even better ways to accomplish my main goal, which is displaying Bitmap data as zoomable and panable images?

推荐答案

我是不满意的WebView毕竟,所以我结束了创建我自己的图像浏览活动。我如何做到了进一步的说明,可以发现在这个职位上谷歌集团

I wasn't satisfied with WebView after all so I ended up creating my own image viewing Activity. Further descriptions on how I did it can be found in this post on google groups.

这篇关于安卓:最简单的做一个web视图显示位图的方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆