Skip to content

Instantly share code, notes, and snippets.

@bwhite
Created March 1, 2014 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwhite/9298165 to your computer and use it in GitHub Desktop.
Save bwhite/9298165 to your computer and use it in GitHub Desktop.
[wearscript] Get one of every preview image size and photo
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
function next_image() {
if (SIZES.length) {
var size = SIZES.pop();
WS.cameraOn(.5, size[0], size[1]);
WS.sound('TAP');
} else {
WS.sound('SUCCESS');
WS.shutdown()
}
}
function server() {
SIZES = [[288, 512], [360, 640], [480, 800], [576, 1024], [720, 1280], [1080, 1920]];
WS.dataLog(false, true, .15);
WS.subscribe('arcalibratenextpreview', next_image);
next_image();
}
function main() {
if (WS.scriptVersion(1)) return;
WS.serverConnect('{{WSUrl}}', server);
}
window.onload = main;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment