How to generate an Image from imageData in javascript?

后端 未结 4 744
日久生厌
日久生厌 2020-12-25 10:45

I would like to know if there is any way to create a new Image from imageData, which was previously obtained from a canvas element?

I\'ve searched for a solution, bu

4条回答
  •  情书的邮戳
    2020-12-25 11:09

    A lot of modern browsers support Data URI scheme.

    If you have the image data, you can set the src attribute of an img element using JavaScript.

    Look at the following example: http://www.websiteoptimization.com/speed/tweak/inline-images/

提交回复
热议问题