Browse Source

fix: 假分辨率影响标靶位置设置问题

songjian-260709
liujiangyong 1 month ago
parent
commit
1f7ed201c2
  1. 8
      client/src/sections/wuyuanbiaoba/components/CameraView.jsx

8
client/src/sections/wuyuanbiaoba/components/CameraView.jsx

@ -158,10 +158,8 @@ const CameraView = ({
if (imgRef.current) {
const img = imgRef.current;
if (img.naturalWidth && img.naturalHeight) {
// setVideoNaturalWidth(img.naturalWidth);
// setVideoNaturalHeight(img.naturalHeight);
setVideoNaturalWidth(8000); //
setVideoNaturalHeight(6000); //
setVideoNaturalWidth(img.naturalWidth);
setVideoNaturalHeight(img.naturalHeight);
// console.log(`handleImageLoad: : ${img.naturalWidth}x${img.naturalHeight}`);
}
resizeCanvas();
@ -1303,7 +1301,7 @@ const CameraView = ({
}}
>
<div>
摄像头分辨率: {videoNaturalWidth} × {videoNaturalHeight}
摄像头分辨率: {8000} × {6000}
</div>
<div>缩放: {Math.round(scale * 100)}%</div>
<div>

Loading…
Cancel
Save