IE和Chrome的图像缩放 [英] Image scaling IE vs. Chrome

查看:72
本文介绍了IE和Chrome的图像缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个32位,96x96透明.png图像,该图像显示在一个高度为24px的页面中,以适合其标题.在Chrome中,该显示效果非常好(边缘清晰且已解析),但是在IE9中,它已完全失真.

我是否需要将图像尺寸从96x96提高到IE才能正确显示?

解决方案

这是ie9(我认为是ie7和8)的默认设置,但实际上有一个CSS解决方案:

  img {-ms-interpolation-mode:双三次;} 

否则,默认情况下将使用最近邻"算法对图像进行下采样.<​​/p>

I have a 32bit, 96x96 transparent .png image that I am displaying in a page with a height of 24px to fit it in my header. In Chrome this displays very nicely (clean edges and resolved), however, in IE9 it is completely distorted.

Do I need to bump the image size from 96x96 to get it to display correctly in IE?

解决方案

This is a default setting in ie9 (and I think ie7 and 8), but it actually has has a css solution:

img {
  -ms-interpolation-mode: bicubic;
}

Otherwise it will default to using the "Nearest Neighbor" algorythm to downsample images.

这篇关于IE和Chrome的图像缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆