diff --git a/src/main/index.js b/src/main/index.js index a4bfc05..f1e8f34 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -11,6 +11,7 @@ function createWindow() { minWidth: 1366, minHeight: 900, height: 1260, + width: 1730, show: false, autoHideMenuBar: true, icon: logoIcon, diff --git a/src/renderer/src/components/formcomponent.vue b/src/renderer/src/components/formcomponent.vue index 01c67b7..2f9f558 100644 --- a/src/renderer/src/components/formcomponent.vue +++ b/src/renderer/src/components/formcomponent.vue @@ -24,19 +24,23 @@ - - - Captured Photo + + +
- +
@@ -80,18 +84,20 @@ export default { return { _: _, dayjs: dayjs, + width: 569, + height: 320, } }, methods: { async openVedio(formItem) { + let that = this try { this.formData[formItem.prop] = "" let stream = await navigator.mediaDevices.getUserMedia({ video: { - width: { ideal: 200 }, - height: { ideal: 200 } + width: { ideal: that.width }, + height: { ideal: that.height } }, - }); this.$refs[`${formItem.prop}video`][0].srcObject = stream; } catch (e) { @@ -103,10 +109,11 @@ export default { } }, takePhoto(formItem) { + let that = this let video = this.$refs[`${formItem.prop}video`][0] let canvas = this.$refs[`${formItem.prop}canvas`][0] let context = canvas.getContext('2d'); - context.drawImage(video, 0, 0, 202, 202); + context.drawImage(video, 0, 0, that.width, that.height); this.formData[formItem.prop] = canvas.toDataURL('image/png'); }, // 聚焦