0

如何截取包括双屏在内的屏幕截图?

document.getElementById('screenshot-button').addEventListener('click', () => { // The button which takes the screenshot
    desktopCapturer.getSources({ types: ['screen'] })
        .then( sources => {
            console.log(sources)
            document.getElementById('screenshot').src = sources[0].thumbnail.toDataURL() // The image to display the screenshot
        })
})
4

0 回答 0