How can I change the image of the fabric.Image
object attribute src, if I have already made an animation?
You could use setSrc()
:
var activeObject = canvas.getActiveObject();
activeObject.setSrc('images/my-image.png', function(img) {
canvas.renderAll();
});
This is best option I found
var activeObject = canvas.getActiveObject();
activeObject.setSrc(data.url);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With