Resizing an image in an HTML5 canvas

后端 未结 18 3118
半阙折子戏
半阙折子戏 2020-11-22 03:37

I\'m trying to create a thumbnail image on the client side using javascript and a canvas element, but when I shrink the image down, it looks terrible. It looks as if it was

18条回答
  •  梦谈多话
    2020-11-22 03:43

    I'd highly suggest you check out this link and make sure it is set to true.

    Controlling image scaling behavior

    Introduced in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)

    Gecko 1.9.2 introduced the mozImageSmoothingEnabled property to the canvas element; if this Boolean value is false, images won't be smoothed when scaled. This property is true by default. view plainprint?

    1. cx.mozImageSmoothingEnabled = false;

提交回复
热议问题