Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to upload picture on canvas in react

componentDidMount() {
  const context = this.canvasA.getContext('2d');

  const image = new Image();
  image.src = "whereever-you-image-url-live.jpg";
  image.onload = () => {
    context.drawImage(image, 0, 0, this.canvasA.width, this.canvasA.height);
  };
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #upload #picture #canvas #react
ADD COMMENT
Topic
Name
4+3 =