html5: copy a canvas to image and back

后端 未结 3 1059
我寻月下人不归
我寻月下人不归 2020-11-28 09:57

I implemented a zoom in and out function on a canvas element. it works by scaling the canvas, translating it, and then redraw the whole scene again. the problem is that it t

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 10:28

    added image into canvas

    var image = new Image();
    image.src = "1.jpg";
    image.onload = function() {
    context.drawImage(image, 0, 0);
    };
    

提交回复
热议问题