javascript - Multiple background images in fabricjs -


i building new app fabricjs, in need

  1. user controlled multiple background images in behave normal image, user can rotate, drag resize it, done stuff multiple bg,

    // 1st img var img = new image(); img.onload = function(){  canvas.setbackgroundimage(img.src, canvas.renderall.bind(canvas), {         originx: 'left',         originy: 'top',         left: 100,         top: 100     }); }; img.src = "site_image/temp/zig3.jpg";  // 2nd img var img1 = new image(); img1.onload = function(){  canvas.setbackgroundimage(img1.src, canvas.renderall.bind(canvas), {         originx: 'left',         originy: 'top',         left: 300,         top: 300     }); }; img1.src = "site_image/temp/zig1.jpg"; 

    but first bg replaced second one, multiple backgrounds controlled user possible or not?

  2. one more issue faced, have json of fabricjs, include image(normal image not background), when show user want image become background of canvas,

just use absolute path in json file , use ajax change backgroud image. can follow [link][1]

[1]: https://jsfiddle . net/manish1706/qxnh4j53/


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -