Skip to content

ElectronNativeImageModule.createFromBuffer method

ElectronNativeImageModule › createFromBuffer

Unofficial

Creates a new NativeImage instance from buffer. Tries to decode as PNG or JPEG first.

Signature:

createFromBuffer(buffer: Buffer, options?: ElectronCreateFromBufferOptions): ElectronNativeImage

Parameters:

ParameterTypeDescription
bufferBufferThe image data to decode.
options?ElectronCreateFromBufferOptionsOptions describing the image dimensions and scale factor.

Returns: ElectronNativeImage — The created image.