Emit NativeImage objects in paint event
This commit is contained in:
parent
3be68ba136
commit
8c4ebdc88e
3 changed files with 24 additions and 42 deletions
|
@ -37,19 +37,18 @@ const {app, BrowserWindow} = require('electron')
|
|||
|
||||
app.disableHardwareAcceleration()
|
||||
|
||||
let win = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 1500,
|
||||
webPreferences: {
|
||||
offscreen: true
|
||||
}
|
||||
})
|
||||
win.loadURL('http://github.com')
|
||||
|
||||
win.webContents.setFrameRate(30)
|
||||
|
||||
win.webContents.on('paint', (event, dirty, data) => {
|
||||
// updateBitmap(dirty, data)
|
||||
let win
|
||||
app.once('ready', () => {
|
||||
win = new BrowserWindow({
|
||||
webPreferences: {
|
||||
offscreen: true
|
||||
}
|
||||
})
|
||||
win.loadURL('http://github.com')
|
||||
win.webContents.on('paint', (event, dirty, image) => {
|
||||
fs.writeSync('frame.png', image.toPNG())
|
||||
})
|
||||
win.webContents.setFrameRate(30)
|
||||
})
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue