Electron 离屏渲染


当前第2页 返回上一页

要启用此模式,必须通过调用 app.disableHardwareAcceleration() API 来禁用GPU加速。

使用

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)
})

标签:Electron

返回前面的内容

相关阅读 >>

创建第一个应用

Electron webcontents 模块

Electron 交互式解释器 (repl)

Electron desktopcapturer 模块

Electron 使用 pepper flash 插件

Electron dom webview 标签

Electron dom file对象

Electron 构建步骤 (os x)

Electron 构建系统概览

关于 Electron

更多相关阅读请进入《Electron》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...