很多人都发现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为同样的值,否则在加载大图片时可能会很慢。

更多相关文章

  1. C语言函数以及函数的使用
  2. android 网络访问-图片处理优秀开源项目
  3. android 开发 解码gif图片,获取每帧bitmap
  4. Android实现插件化(热加载)和插件加密
  5. android图片压缩质量参数Bitmap.Config RGB_565等的含义
  6. Android怎么让RadioButton图片居中显示
  7. 使用ProgressBar实现加载进度条
  8. android点击按钮控制图片切换-kotlin
  9. android 触摸手指动作放大和缩小图片

随机推荐

  1. 盒模型box-sizing功能及相对定位、绝对定
  2. css之flex项目属性与商城首页布局实战
  3. flex的属性描述
  4. js引用,常用数据类型,变量与常量,函数(高阶,箭
  5. wget是一个下载文件的工具
  6. Authing 客户故事|仙工智能
  7. BAT题库 | 机器学习面试1000题系列(第236~
  8. 柔性多模正则匹配引擎
  9. 我对张一得事件的理解
  10. Python自动化测试开发实战 一门能就业的