I have a design in CANVAS designed with the library of FabricJS
, so I need to copy the canvas and return the image but keeping the CANVAS and the Image in the same section of the page. How could I achieve what I want?
HTML
<canvas id="myCanvas" width="400px" height="100px" style="border:solid;">
</canvas>
<img alt="Imagen del Canvas" id="img" width="11" height="12" src="noImg">
ANGULAR / TPYESCRIPT
ngOnInit() {
this.canvas = new fabric.Canvas('myCanvas', );
this.canvas.add(new fabric.IText('Bayern Munchen'));
fabric.Image.fromURL('https://3.bp.blogspot.com/-gunJY3CHi9E/WVDEnsgA7rI/AAAAAAABJzs/oJrbBdyKUToGoBS42ikY6YkWAFTqEGwZgCLcBGAs/s1600/FC%2BBayern%2BMunchen.png', (image) => {
image.set({
left: 50,
top: 50,
});
this.canvas.add(image);
});
}