I have made a canvas and added different objects to it such as images, clipart and text. When I take snap of the canvas when it contains only text, using the method canvas.toDataURL(), it gives me the correct snap. But when I add an image to the canvas, it will return a blank page.
My code is as follows:
canInstance.discardActiveObject();
drawCanvas.loadFromJSON(json,function(){
var img = drawCanvas.toDataURL("png");
$("#previewPopUp").append("<img src='"+ img +"'/>");
});
I am using fabricjs. Can anybody tell how to take a snap of a canvas when it contains a image?