1
我從JSON對象加載畫布並調用toDataURL
但我需要一個回調,它將在畫布加載後執行,因爲如果畫布上有圖像,toDataURL
函數返回因爲在圖像加載之前調用了空白頁面。Fabric.js - 如何爲畫布加載事件給出回調
canvas.loadFromJSON(json);
// I need an event handler here which will be executed after canvas is loaded
var dataURL = canvas.toDataURL();
閱讀本手冊! http://fabricjs.com/docs/fabric.Canvas.html#loadFromJSON – ComFreek
我認爲這個問題應該鏈接到:http://stackoverflow.com/questions/18311448/loadfromjson-function-is-loading-objects-filled -with圖案僅-後點擊 – coolfeature