- 1
- 1 749
Markinagain
เข้าร่วมเมื่อ 4 เม.ย. 2014
How To Take A Screenshot With Electron - desktopCapturer
Github link: github.com/markpenovich/electron-screenshot-example
Utilize desktopCapturer and screen modules from electron to take a screenshot using the contextBridge
Utilize desktopCapturer and screen modules from electron to take a screenshot using the contextBridge
มุมมอง: 1 749
Thanks Bro
Merci Markouuuu
Very helpful, thank you Mark👍
I want to upload the image on server. How can I proceed that?
What is interesting though. Is if you're on multiple monitors, it on takes a screenshot of monitor 1
If you want to change the monitor you need to change up the captureScreen() function in main.js a bit. You can use screen.getAllDisplays() instead of screen.getPrimaryDisplay(). That will give you an array of all the monitors that are hooked up. Then from there you can extract the size and display_id of the monitor you want and change the function to use those.
I tried a few github repo's but yours works and this video is useful thank you.
hey i am getting this error : Cannot read properties of undefined (reading 'captureScreenShot'). ave any solution for it?
works for me.. there is a link to the code in the video description