I am using desktopCapturer to take and the code below to take a desktop screenshot.
takeScreenshot() {
desktopCapturer.getSources({ types: ['screen'] })
.then( (sources: { thumbnail: { toDataURL: () => any; }; }[]) => {
const theimage = sources[0].thumbnail.toDataURL(); // Thumbnail size image
})
}
My question is: sources[0].thumbnail.toDataURL() is very small.
Can it either be made large or is the large version of the image somewhere in sources?
If so where or how?
You can pass thumbnailSize as a setting to getSources().
https://www.electronjs.org/docs/latest/api/desktop-capturer#methods
takeScreenshot() {
desktopCapturer.getSources({ types: ['screen'], thumbnailSize: { width: 800, height: 600 })
.then( (sources: { thumbnail: { toDataURL: () => any; }; }[]) => {
const theimage = sources[0].thumbnail.toDataURL(); // Thumbnail size image
})
}