HTMLcopy
1
<div id="container"></div>
2
<div style="position: absolute; top: 40px; right: 25px; width: 31%;">
3
<input style="margin-bottom: 10px;" type="button" value="getJpgBase64String" onclick="getJpgBase64String()">
4
<textarea style="width: 100%;" rows="5" cols="70" id="getJpgBase64String"></textarea>
5
</div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
stage = acgraph.create("container");
2
stage.circle(250, 220, 200);
3
stage.rect(0, 0, 500, 450);
4
5
function getJpgBase64String() {
6
7
// Get JPG as base64 string.
8
stage.getJpgBase64String(function (response) {
9
var base64String = document.getElementById('getJpgBase64String');
10
base64String.innerHTML = response;
11
});
12
}