var canvas=document.getElementById('demoCanvas'); canvas.width=window.innerWidth; canvas.height=window.innerHeight; var stage=new createjs.Stage('demoCanvas'); var container=new createjs.Container();//绘制外部容器 stage.addChild(container); //加载图片 var image=new Image(); image.src="img/Lighthouse.jpg"; image.onload=handlerImageLoad; function handlerImageLoad(event){ var bitmap=new createjs.Bitmap(event.target); bitmap.x=canvas.width-bitmap.getBounds().wdith>>1; bitmap.y=canvas.height-bitmap.getBounds().height>>1; container.addChild(bitmap); stage.update(); }