<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>GGB截屏</title>
<style type="text/css">
img.snap {
max-width: 150px;
max-height: 150px;
}
</style>
</head>
<body>
<div id="applet"></div>
<img class="snap" src="">
<img class="snap" src="">
<img class="snap" src="">
<img class="snap" src="">
<script src="http:
<script src="../GeoGebra/deployggb.js"></script>
<script>
var busy = false;
var applet = new GGBApplet({ showToolbar: true, width: 500, height: 400, appletOnLoad: function() {
ggbApplet.registerAddListener('ggbChanged');
ggbApplet.registerUpdateListener('ggbChanged');
ggbApplet.registerRemoveListener('ggbChanged');
}});
applet.setHTML5Codebase('../GeoGebra/HTML5/5.0/web/', true);
window.onload = function() {
applet.inject('applet', 'html5');
};
function ggbChanged(name) {
if (name) {
return setTimeout('ggbChanged()', 100);
}
base64 = ggbApplet.getPNGBase64(0.6, true, 96);
if (base64) {
var $img = $('img.snap');
for (var i = 2; i >= 0; i--) {
if (/^data:image/.test($img[i].src)) {
$img[i + 1].src = $img[i].src;
}
}
$img[0].src = 'data:image/png;base64,' + base64;
}
}
</script>
</body>
</html>