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

Loading…
Cancel
Save