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 | undefined): ElectronNativeImage

Parameters:

Parameter Type Description
buffer Buffer The image data to decode.
options? ElectronCreateFromBufferOptions | undefined Options describing the image dimensions and scale factor.

Returns: ElectronNativeImageThe created image.