Android: WebView doesn't scale large images -
i'm using webview show image:
webview.setinitialscale(10); string myhtml = ("<html><head></head><body><img src=\"" + imguri + "\"></body></html>"); webview.loaddatawithbaseurl("file:///android_asset/", myhtml, "text/html", "utf-8", "");
the problem if imguri points large image (eg.2000 x 3000 px) downscaling doesn't work. think limit somewhere around 30%, underneath initialscale value image stays @ around 30% size. so, example setting initialvalue 10, 20 or 30 produces similar image size.
is there way use webview show large image scaled down example 10%?
pom
if have to, maybe try browser-end resizing of sort via javascript or css (e.g. http://atomgiant.com/2006/05/30/resize-images-with-javascript/). sending images large on wire result in pretty s l o w user experience -- if have control on web server involved, or if you're using service provides images in scaled sizes well, try sending smaller version in first place.
Comments
Post a Comment