在Android上以原始分辨率显示不可缩放的网页?

mar*_*hep 4 html android

我已将以下内容添加到网页中,以使其在移动设备上不可缩放,并尝试以原始分辨率显示:

<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,user-scalable=no" /> 
Run Code Online (Sandbox Code Playgroud)

然而,当我在三星Galaxy S上观看并screen.width从JavaScript 打印出来时,它在纵向方向上提供320,在横向方向上提供533.如何才能使用480×800的原始分辨率,或者这是不可能的?

我想这样做,以便通过以1.5的变焦显示图像的质量不会降低(最初像素化然后应用平滑滤波器).

Mik*_*ike 6

此视口语法实现了所需的行为:

<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width" />
Run Code Online (Sandbox Code Playgroud)

通过指定目标密度以匹配显示器的原始密度,它以原始分辨率(1pixel = 1pixel)渲染,并且您看不到平滑或其他伪影.

适用于三星Galaxy S,但YMMV适用于其他设备和Android /浏览器版本.

有关详细信息,请参见下文

http://developer.android.com/guide/webapps/targeting.html#ViewportDensity