Browse Source

[完善]显示矩形高度

develop
邵佳豪 2 years ago
parent
commit
3c2c680be0
  1. 2
      src/app/system-management/image-label2/image-label2.component.html
  2. 8
      src/app/system-management/image-label2/image-label2.component.ts
  3. 6
      src/app/system-management/navigation/navigation.component.html

2
src/app/system-management/image-label2/image-label2.component.html

@ -25,6 +25,8 @@
(nzOnConfirm)="clearCanvas()">清空</button>
<label *ngIf="camerasData" class="rightTitle">原始分辨率: {{camerasData.originalWeight}} ×
{{camerasData.originalHeight}}</label>
<!-- <label *ngIf="markType === 2 && !isDrawArrow" class="rightTitle">当前矩形框高度为:{{rectangleHeight}}px,请确保低于420px</label> -->
</div>
<div class="imgbox">
<div class="content">

8
src/app/system-management/image-label2/image-label2.component.ts

@ -255,6 +255,7 @@ export class ImageLabel2Component implements OnInit {
}
//初始化 canvas画布 监听事件
initCanvasEvent(canvas) {
let context = canvas.getContext('2d');
canvas.onmousedown = (e) => { //鼠标按下事件
@ -312,6 +313,8 @@ export class ImageLabel2Component implements OnInit {
context.strokeStyle = this.oilUnloadingArea ? "green" : "red";
let element = this.getOblongInfo(this.downx, this.downy, moveX, moveY)
context.strokeRect(element.x, element.y, element.width, element.height);
context.font = '22px Arial';
context.fillText('高度:' + element.height, element.x + 3, element.y + 22);
}
}
}
@ -429,6 +432,8 @@ export class ImageLabel2Component implements OnInit {
context.strokeStyle = element.oilUnloadingArea ? "green" : "red";
context.lineWidth = 3;
context.strokeRect(element.x, element.y, element.width, element.height);
context.font = '22px Arial';
context.fillText('高度:' + element.height, element.x + 3, element.y + 22);
});
}
// console.log(789, pointsList)
@ -527,6 +532,7 @@ export class ImageLabel2Component implements OnInit {
//canvas 绘制矩形
drawOblong(oblongList, context) {
console.log('xxxxxxxxxxxxxxxxxxxxxxxxxxi')
context.clearRect(0, 0, this.canvasWidth, this.canvasHeight);
this.copyCanvas ? context.putImageData(this.copyCanvas, 0, 0) : null;
if (this.markType === 2) { //同时绘制 直线箭头
@ -537,6 +543,8 @@ export class ImageLabel2Component implements OnInit {
context.strokeStyle = element.oilUnloadingArea ? "green" : "red";
context.lineWidth = 3;
context.strokeRect(element.x, element.y, element.width, element.height);
context.font = '22px Arial';
context.fillText('高度:' + element.height, element.x + 3, element.y + 22);
});
}

6
src/app/system-management/navigation/navigation.component.html

@ -16,11 +16,11 @@
<li [routerLink]="['/system/organization']" routerLinkActive="router-link-active"><img
src="../../../assets/images/icon/organization.png" alt="">组织机构管理</li>
<li [routerLink]="['/system/host']" routerLinkActive="router-link-active"><img
src="../../../assets/images/icon/host.png" alt="">边缘盒子管理</li>
src="../../../assets/images/icon/host.png" alt="">边缘设备管理</li>
<li [routerLink]="['/system/conditionMonitoring']" routerLinkActive="router-link-active"><img
src="../../../assets/images/icon/push.png" alt="">边缘盒子更新</li>
src="../../../assets/images/icon/push.png" alt="">边缘设备更新</li>
<li [routerLink]="['/system/statusMonitoring']" routerLinkActive="router-link-active"><img
src="../../../assets/images/icon/push.png" alt="">边缘盒子监控</li>
src="../../../assets/images/icon/push.png" alt="">边缘设备监控</li>
<li [routerLink]="['/system/videoStreaming']" routerLinkActive="router-link-active"><img
src="../../../assets/images/icon/push.png" alt="">视频流监控</li>
<!-- <li [routerLink]="['/system/kafka']" routerLinkActive="router-link-active"><img

Loading…
Cancel
Save