title: Fit an image inside a rectangle in easelJS
body: <p>I am new to easelJS and I was trying to fit an image inside a rectangle. I am able to set the x,y but not the width and height. What is the right approach?</p>
  
  <pre><code>    var stage = new createjs.Stage("canvas");
      var layoutWidth = 0.8 * stage.canvas.width;
      var layoutHeight = 0.6 * stage.canvas.height;
      var layoutRect = new createjs.Shape();
      layoutRect.graphics.beginStroke("black").drawRect((stage.canvas.width - layoutWidth) / 2, (stage.canvas.height - layoutHeight) / 2, layoutWidth, layoutHeight);
      var imageContainer = new createjs.Shape();
      imageContainer.graphics.beginStroke("black").drawRect((stage.canvas.width - layoutWidth) / 2 + (layoutWidth - 0.25 * layoutWidth) / 2, (stage.canvas.height - layoutHeight) / 2 + 0.1 * layoutHeight, 0.25 * layoutWidth, 0.25 * layoutWidth);
      var image = new createjs.Bitmap("pizza.jpg");
      image.x = (stage.canvas.width - layoutWidth) / 2 + (layoutWidth - 0.25 * layoutWidth) / 2;
      image.y = (stage.canvas.height - layoutHeight) / 2 + 0.1 * layoutHeight;
      stage.addChild(layoutRect, imageContainer, image);
      stage.update();
  </code></pre>
  
  <p>I want to place the image inside image container. </p>