M
M
Malik2021-02-15 08:50:24
Vue.js
Malik, 2021-02-15 08:50:24

How to send a screenshot to the server?

const canvas = this.$refs.canvas
      const video = this.$refs.video

      const img = new Promise((resolve) => {
        const ctx = canvas.getContext('2d')
        const w = video.videoWidth
        const h = video.videoHeight
        canvas.width = w
        canvas.height = h

        ctx.drawImage(video, 0, 0, w, h)
        ctx.font = '16px Arial'
        ctx.fillText((new Date()).toString(), 0, 20)

        canvas.toBlob((blob) => {
          resolve(blob)
        }, 'image/jpeg')
      })

I implemented the camera and the screen through video and canvas, I need to send the image screen to the server, tell me how can I send the screen based on this code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Volodymyr Palamar, 2021-02-15
@GORNOSTAY25

Use this or this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question