Companion

Functions

Link copied to clipboard

Creates an empty NativeImage instance.

Link copied to clipboard
fun createFromBitmap(buffer: ERROR CLASS: Symbol not found for Buffer<*>, options: CreateFromBitmapOptions): NativeImage

Creates a new NativeImage instance from buffer that contains the raw bitmap pixel data returned by toBitmap(). The specific format is platform-dependent.

Link copied to clipboard
fun createFromBuffer(buffer: ERROR CLASS: Symbol not found for Buffer<*>, options: CreateFromBufferOptions = definedExternally): NativeImage

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

Link copied to clipboard

Creates a new NativeImage instance from dataUrl, a base 64 encoded Data URL string.

Link copied to clipboard
fun createFromNamedImage(imageName: String, hslShift: ERROR CLASS: Symbol not found for js.array.ReadonlyArray<kotlin/Double> = definedExternally): NativeImage

Creates a new NativeImage instance from the NSImage that maps to the given image name. See Apple's NSImageName documentation for a list of possible values.

Link copied to clipboard

Creates a new NativeImage instance from an image file (e.g., PNG or JPEG) located at path. This method returns an empty image if the path does not exist, cannot be read, or is not a valid image.

Link copied to clipboard
fun createThumbnailFromPath(path: String, size: Size): ERROR CLASS: Symbol not found for Promise<electron/core/NativeImage>

fulfilled with the file's thumbnail preview image, which is a NativeImage.