docs: add example for taking screenshot (#20531)

This commit is contained in:
Harendra Singh 2019-10-16 20:47:50 +05:30 committed by Shelley Vohr
parent c73e34fb9e
commit db91673f23
3 changed files with 93 additions and 0 deletions

View file

@ -0,0 +1,25 @@
const { BrowserWindow, app } = require('electron')
let mainWindow = null
function createWindow () {
const windowOptions = {
width: 600,
height: 300,
title: 'Take a Screenshot',
webPreferences: {
nodeIntegration: true
}
}
mainWindow = new BrowserWindow(windowOptions)
mainWindow.loadFile('index.html')
mainWindow.on('closed', () => {
mainWindow = null
})
}
app.on('ready', () => {
createWindow()
})