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 desktopcapturer 模块

Electron 构建步骤 (windows)

Electron 离屏渲染

Electron clipboard 模块

Electron screen 模块

Electron 自动更新功能autoupdater

开发环境

Electron powersaveblocker 模块

Electron browserwindow 模块

Electron 教程简介

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




打赏

取消

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

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

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

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

评论

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