[英]Load bitmap as a content of webview
First I load the bitmap from url and then I want to load this bitmap to webview element. 首先,我从url加载位图,然后再将此位图加载到webview元素。 Is there a way to load bitmap from the app install folder?
有没有办法从应用程序安装文件夹加载位图?
If you only want to show off the Bitmap, you might want to use an ImageView
. 如果只想炫耀位图,则可能要使用
ImageView
。
Otherwise, I guess the picture is in your res/drawable
or assets
-folder: 否则,我猜图片在您的
res/drawable
或assets
夹中:
To show the Image from the assets
-folder use the following: 要显示
assets
夹中的图像,请使用以下命令:
browser.loadUrl("file:///android_asset/yourfile.png");
Where browser
is your WebView
-Object. browser
是您的WebView
-Object。
To show the Image from the res
-folder, you use something like this: 要显示
res
夹中的Image,请使用以下命令:
browser.loadUrl("file:///android_res/drawable/yourfile.png");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.