我正嘗試使用Easel.js在畫布中創建可重新調整大小的數據庫圖標。我想出瞭如何創建基礎圓柱,但無法找出堆棧的曲線。該數據庫的圖標看起來應該像下面這個鏈接:如何使用Easel.js在畫布中創建數據庫圖標
http://icons.iconarchive.com/icons/visualpharm/icons8-metro-style/256/Data-Database-icon.png
我已經開始的圖標的創作上的jsfiddle如下: http://jsfiddle.net/rsperlazza/u6Uaq/
var stage = new createjs.Stage($("#test")[0]);
stage.enableMouseOver(50);
stage.canvas.width = 500;
stage.canvas.height = 500;
var shape = new createjs.Shape();
var g = shape.graphics;
var x = 50;
var y = 100;
var width = 100;
var height = 120;
g.beginStroke("red");
g.beginFill("black");
g.drawEllipse(x, y, width, height/4);
g.moveTo(x, y + height/8);
g.lineTo(x, y + 7 * height/8);
g.moveTo(x, y + height/8);
g.lineTo(x, y + 7 * height/8);
g.drawEllipse(x, y + 3 * height/4, width, height/4);
g.endStroke();
g.drawRect(x, y + height/8, width, 3 * height/4);
stage.addChild(shape);
stage.update();