如何在画架js中画一个虚线圆圈

Jos*_*lli 2 javascript canvas html5-canvas easeljs

如何在画架js中画一个虚线圆圈?我想创建一个圆,外线应该是虚线格式。如何解决这个问题?

输出:

请参考此链接:http : //www.polyvore.com/dotted_circle/thing?id=75092766

Lan*_*nny 5

查看 GitHub 中的“Graphics_setStrokeDash.html”示例。这是源的链接。 https://github.com/CreateJS/EaselJS/blob/master/examples/Graphics_setStrokeDash.html

请注意,它不适用于较早的 IE 版本 (<11)。

片段:

shape.graphics.setStrokeDash([2,2]);
shape.graphics.setStrokeStyle(2).beginStroke("green").rect(380,20,100,100);
Run Code Online (Sandbox Code Playgroud)