desktopCapturer: Screenshot of desktop (not video) is slightly out of focus (little blurry)


#1

With the example of this page (https://electron.atom.io/docs/api/desktop-capturer) I take screenshots of the desktop (not videos). Everthing ist allright - but the image of the screenshot is is slightly out of focus (little blurry).

I’ve also build with NW.js (http://docs.nwjs.io/en/latest/References/Window/#wincapturepagecallback-config) a tool to take screenshots - but also with NW.js the image has the unwanted effect: The screenshot is is slightly out of focus (little blurry). It seems, NW.js uses the Navigator.getUserMedia() too. Therfor I think the reason of the unwanted effect is in Navigator.getUserMedia().

In the example the access to getUserMedia is as follows:

navigator.webkitGetUserMedia({
 audio: false,
 video: {
  mandatory: {
   chromeMediaSource: 'desktop',
   chromeMediaSourceId: sources[i].id,
   minWidth: 1280,
   maxWidth: 1280,
   minHeight: 720,
   maxHeight: 720
  }
 }
}, handleStream, handleError)

I could imagine that there is an option to take screenshot without “blur” …

How can I take screenshot without blur?


#2

After rebooting everthing is ok without modification - strange … I will keep an eye on it.


#3

The problem still exists: After first start of my app (Windows 7) I take a screenshot - everthing is ok. Then only I resize the window of my app and take a screenshot again: The image is a little bit blurry. The same issue occurs with NW.js too. Does anyone confirm the issue? Does anyone know a workaround - e. g. redraw the window before capturing?


#4

I found my error:

After capturing I crop the screenshot with the graphic functions of canvas. Now I realized, that the values in my “cropper” sometimes contains numbers with comma. But they have to be integer - problem solved.

PS: The function “win.capturePage” (https://electron.atom.io/docs/api/browser-window/) makes screenshots much easier than “desktopCapturer” (https://electron.atom.io/docs/api/desktop-capturer/)

PS2: “win.capturePage” has manipulation functions (electron.atom.io/docs/api/native-image) e.g. crop - but canvas has more functions …