画布图像平滑 [英] Canvas Image Smoothing

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

问题描述

什么是


ctx.mozImageSmoothingEnabled = false;

ctx.mozImageSmoothingEnabled = false;

适用于webkit(或其他浏览器)?我需要它去除反锯齿,因为我试图得到一个像素化效果的图像。

for webkit(or other browsers)? I need it to remove anti-aliasing because i am trying to get a pixelized effect to an image. With anti-aliasing, it looks bad-quality but with no sharp edges.

推荐答案

对于< ; canvas> 标签,WebKit nightlies r117635和Chrome Canary 21.0.1154.0现在有了一个webkitImageSmoothingEnabled属性。 (注意,这只适用于< canvas> ,而不是更普遍的HTML元素。)

For the <canvas> tag, WebKit nightlies after r117635 and Chrome Canary 21.0.1154.0 now have a webkitImageSmoothingEnabled attribute. (Note that this applies only to <canvas>, not to HTML elements more generally.)

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

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