Use images created from canvas

I know that I can save the image from the canvas using canvas.toDataURL (). But how can I use it right away?

Here's the script:

I have a basket with a custom product. By changing the attributes, I can create an individual image of the product using a canvas. Immediately after adding to the basket, I want to use the generated canvas image as a basket thumbnail for the product added to the basket.

How can i achieve this? Can someone help me with an idea for a programming workflow to achieve this? I am using Drupal + Ubercart with this.

+3
source share
1 answer
  • ( script new Image, document.createElement("img") DOM). <img>, script.

  • () onload , .

  • src URL- .

onload src . URL- src URL- ?

+1

Source: https://habr.com/ru/post/1793755/


All Articles