0
当我使用drawImage方法来scalle一个大图像(如5M),结果看起来很可怕,是有可以scalling图像抗锯齿任何更简单的方法? MDN提到这一点:如何用drawImage在画布上平滑地缩放大图像?
注:扩大或呈颗粒状,如果他们按比例缩小太多,当图像可以变得非常模糊。如果你有一些需要保持清晰的文字,缩放可能是最好的。
EIDT:我想一个图像扩展到90x90,和我的代码是这样的:
that.avatar_height >= that.avatar_width ?
that.context.drawImage($(this)[0], 86, 2, 90, that.avatar_height*90/that.avatar_width) :
that.context.drawImage($(this)[0], 86, 2, that.avatar_width*90/that.avatar_height, 90);
头像是要缩放图像。
谢谢你,但看到我的编辑,像你刚才提供我的方式是一样的,它不工作: ( – jiguang
我使用上述方式完成了它为我工作。 – vvr02