There are multiple images in the canvas how to select one programmatically in fabric js
fabric.Image.fromURL(this.imageSrc, (img) => {
let oImg = img.set({
left: 0,
top: 0,
angle: 0,
}).scale(1);
this.canvas.add(oImg).renderAll();
You can assign an image to a variable like this:
Since the image object is now stored as
oImg, you can select it like this:Or, you can select objects in the canvas based on their index like this: