title: Fabric JS set backgroundImage from fabric object
body: <p>I want to create an artboard like sketch's artboard in fabric canvas elemet
  like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let app = new Vue({
    el: '#app',
    computed: {
     canvasSize() {
        let VM = this
        let  el, width, height
        el = VM.$refs.canvasBoxWrap
        width = el.clientWidth
        height  = el.clientHeight
        return  { width, height }
      }
    },
    data: {
      dSize: ''
    },
    mounted() {
      let VM = this
      
      VM.dSize = VM.canvasSize
  
  
      let fabricCanvasInit = () =&gt; {
        let canvas = new fabric.Canvas(VM.$refs.facanvas , {
          enableRetinaScaling: true
        })
        canvas.set({
          'enableRetinaScaling': true,
          'backgroundColor': '#dddddd'
        })
        canvas.setWidth( VM.canvasSize.width)
        canvas.setHeight(VM.canvasSize.width / 16 * 9)
        // canvas.set('enableRetinaScaling', true)
        // canvas.set('backgroundColor' , '#dddddd')
  
        let artBoard = new fabric.Rect({
          stroke: '#000',
          strokeWidth:1,
          fill: 'rgba(255,255,255,1)',
          width: VM.canvasSize.width  - 80,
          height: VM.canvasSize.width  / 16 * 9 - 80
          ,
          shadow : {
            color: 'rgba(0,0,0,0.5)',
            blur: 20,
            offsetX: 0,
            offsetY: 10,
            opacity: 0.6,
            fillShadow: true
          }
        })
  
        canvas.add(artBoard)
        canvas.artBoard = artBoard
        canvas.artBoard.center()
        canvas.artBoard.set({
          'selectable' : false
        })
        canvas.renderAll()
        console.log( canvas );
      }
  
      fabricCanvasInit()
    }
  })</code></pre>
  </div>
  </div>
  </p>
  
  <p>but in this demo, the "artboard" was created by a fabric rect object.
   When I change other object , like 'sendToBack()', I will reset the "artboard" object sendToBack() 
  I want add the rect with shadow like fabricCanvas.setBackgroundImage(...)
  how to do that?</p>
  
  <p><a href="https://jsfiddle.net/evolutionjay/6Ly3p5dd" rel="nofollow noreferrer">jsfiddle.net demo</a></p>