Browse Source

test canvas size

tags/v1.21.12.1
zhoupzh 4 years ago
parent
commit
b2b217fa09
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      public/self/js/Director/detection.js

+ 2
- 2
public/self/js/Director/detection.js View File

@@ -2853,8 +2853,8 @@ function isJSON(str) {
img.onload = function(){
loadFinished = false;
// 初始设置画布大小,最大值宽和高
canvas.width = maxWidth;//document.getElementById("tool0").offsetWidth;
canvas.height = maxHeight;//document.getElementById("tool0").offsetWidth/1280*720;
canvas.width = img.width;// maxWidth document.getElementById("tool0").offsetWidth;
canvas.height =img.height;//maxHeight document.getElementById("tool0").offsetWidth/1280*720;
//调整画布大小
if ((img.width/img.height)<(canvas.width/canvas.height)){
canvas.width=canvas.height * img.width / img.height;


Loading…
Cancel
Save