首页 > 其他分享 >Android浏览器显示大分辨率图片的问题 分享

Android浏览器显示大分辨率图片的问题 分享

时间:2023-02-06 19:37:09浏览次数:38  
标签:浏览器 分辨率 sites should Android com android 图片


很多人都发现android的浏览器显示大分辨图片会出现显示模糊的问题,我测试是超过100万像素(1024x1024)的图片就会出现模糊。在android的讨论网站上也有对这个问题的一个issue(http://code.google.com/p/android/issues/detail?id=6021 )。 很明显这是android的浏览器实现代码在加载图片的时候做了限制。相关代码在 external/webkit/WebCore/platform/graphics/android /ImageSourceAndroid.cpp,这个文件中有一个局部函数computeMaxBitmapSizeForCache(),看一下这个 函数前面的注释:
Images larger than this should be subsampled. Using ashmem, the decoded
pixels will be purged as needed, so this value can be pretty large. Making
it too small hurts image quality (e.g. abc.com background). 2Meg works for
the sites I've tested, but if we hit important sites that need more, we
should try increasing it and see if it has negative impact on performance
(i.e. we end up thrashing because we need to keep decoding images that have
been purged.

Perhaps this value should be some fraction of the available RAM...
已经说得很明白了,可以修改这个函数里面的常数(2*1024*1024),不过修改这个值以后记得改一下上面的一个宏定义MIN_RLE_ALLOC_SIZE为同样的值,否则在加载大图片时会很慢。

标签:浏览器,分辨率,sites,should,Android,com,android,图片
From: https://blog.51cto.com/u_15955464/6040287

相关文章

  • 按键测试,支持像 Ctrl+Alt+Shift+T 的组合键(注:非浏览器热键)
    <html><head></head><bodyonkeyup="window.alert(showKeyName(event))">按键测试,支持像Ctrl+Alt+Shift+T的组合键(注:非浏览器热键)<scripttype="text/javascript">functio......
  • android下的读写权限
    建立两个项目,一个是写数据_相关,一个是读数据_相关数据,写数据_相关            读数据_相关数据作用:对上面的项目的文件进行读写操作,看看是否能成......
  • 单元测试1(Androidf)
    步骤:incrment)。 --incrmentMathUtils类中的main方法直接测试,会有异常,如下:Ifyouwouldliketosubmitabugreport,pleasevisit:​​​  http://java.sun.co......
  • adb的常用命令(android debud bridge)
    android调试桥:adb命令使用需要在系统环境遍历中path中追加adb.exe的完整路径D:\IDE\adt-bundle-windows-x86-20130729\sdk\platform-toolsadbdevices列出所有的设备 ......
  • Android中的显示单位
     px(pixels)像素    一般HVGA代表320x480像素,这个用的比较多。 dip或dp(deviceindependentpixels)设备独立像素  这个和设备硬......
  • 单元测试2(android)
    在另一个Junit中测试工程的某一个方法。在Junit中的测试(JunitTest)MathUtils类中的incrment方法这时候,清单文件已经帮你配置好了<?xmlversion="1.0"encoding="utf-8"?><......
  • Android 测试
    黑盒测试:是以用户的角度,从输入数据与输出数据的对应关系出发进行测试的。白盒测试:又称结构测试、透明盒测试、逻辑驱动测试或基于代码的测试。......
  • error:This Android SDK requires Andr...ate ADT to the latest version.
    这样的问题很好解决,一个升级ADT到指定版本或以上,另一个简单的办法是调低SDK版本找到android-sdk-windows\tools\lib下的plugin.prop文件修改其中的版本号,改为与所安装的AT......
  • Android 电话拨号
    以下案例模拟android电话拨号器的实现AndroidManifest.xml清单列表:<?xmlversion="1.0"encoding="utf-8"?><manifestxmlns:android="http://sche......
  • Android Activity之间跳转相互传值
    Intent用法实例:1.无参数Activity跳转Intentit=newIntent(Activity.Main.this,Activity2.class);startActivity(it);2.向下一个Activity传递数......