'how could I draw a rectangle inside an image using Angular using canvas?

I need to draw a rectangle inside an image recording to x,y. I used a canvas tag and inside it I used an img tag but the image didn't appear because the canvas overwrite an image. so how can I integrate 2 elements without overwrite to get the result like this image below it has a green rectangle around the plate box... enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source