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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -