android - WebView autoscales local images -
my question similar this one, different enough going post new one.
i writing image viewer downloads png remote server, saves storage, , opens in webview
multi-touch zoom free. these images going documents, user want able zoom in far. sending down images of sufficient resolution enable this, webview
seems "helping" me scaling image screen size start out with. means image low resolution zoomed in on.
i have searched around this, , have found other people encountering similar problem, possible solution found cut image tiles , reassemble them using html before loading in view. seems kludge, , asking stackoverflow hivemind if has either way turn off scaling, or alternative method need.
the code initializes webview
:
viewer = (webview)findviewbyid(r.id.activity_imageviewer_webview); viewer.setbackgroundcolor(0); websettings settings = viewer.getsettings(); settings.setjavascriptenabled(false); settings.setbuiltinzoomcontrols(true); settings.setusewideviewport(true); settings.setloadwithoverviewmode(true);
the code loads image webview
:
viewer.loadurl(uri.fromfile(imagefile).tostring());
changing viewport properties might help, take @
<meta name="viewport" ...>
meta tag in html header
Comments
Post a Comment