HTMLcopy
1
<button onclick="shareAsPng();">Get the link to PNG image</button>
2
<div id="container"></div>
CSScopy
9
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
7
button {
8
margin: 10px 0 0 10px;
9
}
JavaScriptcopy
x
1
var stage = acgraph.create('container');
2
stage.circle(300, 250, 200);
3
stage.rect(100, 50, 400, 400);
4
5
function shareAsPng() {
6
7
// Share stage as PNG image.
8
stage.shareAsPng(function (response) {
9
alert(response);
10
});
11
}