离屏渲染
时间:2020-01-23 12:49:37
收藏:0
阅读:127
再次渲染时候,可以从位图缓存中获取数据,只更新脏区
const {app, BrowserWindow} = require(‘electron‘) app.disableHardwareAcceleration() let win app.once(‘ready‘, () => { win = new BrowserWindow({ webPreferences: { offscreen: true } }) win.loadURL(‘http://github.com‘) win.webContents.on(‘paint‘, (event, dirty, image) => { // updateBitmap(dirty, image.getBitmap()) }) win.webContents.setFrameRate(30) })
原文:https://www.cnblogs.com/justart/p/12230452.html
评论(0)