Skip to content

ElectronNativeImage.getBitmap method

ElectronNativeImage › getBitmap

Unofficial

Returns a buffer that contains the image's raw bitmap pixel data. The difference between getBitmap() and toBitmap() is that getBitmap() does not copy the bitmap data, so the returned buffer must be used immediately in the current event loop tick; otherwise the data might be changed or destroyed.

Signature:

getBitmap(options?: ElectronNativeImageScaleFactorOptions | undefined): Buffer

Parameters:

Parameter Type Description
options? ElectronNativeImageScaleFactorOptions | undefined Options for the bitmap conversion including scaleFactor.

Returns: BufferThe image's raw bitmap pixel data.