How do I get the WVGA Android browser to stop scaling my images?

Posted by Dan Fabulich on Stack Overflow See other posts from Stack Overflow or by Dan Fabulich
Published on 2010-05-09T06:20:44Z Indexed on 2010/05/09 6:28 UTC
Read the original article Hit count: 261

Filed under:
|
|
|

I'm designing an HTML page for display in Android browsers. Consider this simple example page:

<html>
<head><title>Simple!</title>
</head>
<body>
<p><img src="http://sstatic.net/so/img/logo.png"></p>
</body>
</html>

It looks just fine on the standard HVGA phones (320x480), but on HDPI WVGA sizes (480x800 or 480x854) the built-in browser automatically scales the image up; it looks ugly.

I've read that I should be able to use this tag to force the browser to stop scaling my page:

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;" />

... but all that does is disable user scaling (the zoom buttons disappear); it doesn't actually prevent the browser from scaling my image. Adjusting the scale factors (setting them all to 2.0 or 0.5) has no effect at all.

How can I force the WVGA browser to stop scaling my images?

© Stack Overflow or respective owner

Related posts about android

Related posts about browser