9
0
mirror of https://gitee.com/shuto/customCamera.git synced 2026-05-02 00:07:24 +08:00

Ajout d'une option pour changer l'image en surimpression en fonction de l'orientation de l'écran.

This commit is contained in:
Christophe Boucaut
2015-01-29 18:58:52 +01:00
parent 9e0b9348f5
commit c785aed2b1
5 changed files with 58 additions and 9 deletions
+6 -1
View File
@@ -1,7 +1,11 @@
function getGrid() {
function getGrid(inverse) {
var format = "image/png";
var width = window.innerWidth * devicePixelRatio;
var height = window.innerHeight * devicePixelRatio;
if (inverse) {
width = window.innerHeight * devicePixelRatio;
height = window.innerWidth * devicePixelRatio;
}
var widthInterval = width * 0.25;
var heightInterval = height * 0.25;
var x = widthInterval;
@@ -39,6 +43,7 @@ document.getElementById("start-camera").onclick = function() {
navigator.GeneanetCustomCamera.startCamera(
{
imgBackgroundBase64: getGrid(),
imgBackgroundBase64OtherOrientation: getGrid(true),
opacity: false,
miniature: false
},