JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<body>
<img src="Desert.jpg" alt="Canvas Image" id="imgSampleImage" />
<canvas id="myCanvas" width="400" height="300" style="border:1px solid #000;">
Sorry! your browser does not support Canvas.
</canvas>
<script type="text/javascript">
var img = new Image(); // Create new img element
img.onload = function () {
// execute drawImage statements here
};
imageObj.src = "~\Content\Desert.jpg";
</script>
</body>
</html>