ElectronNativeImageModule
Unofficial
Electron nativeImage module for creating tray, dock, and application images from various sources.
Import:
import type { ElectronNativeImageModule } from '@obsidian-typings/obsidian-catalyst-latest';Signature:
export interface ElectronNativeImageModuleMethods
| Method | Returns | Description | |
|---|---|---|---|
| createEmpty() | ElectronNativeImage | Creates an empty NativeImage instance. | |
| createFromBitmap(buffer, options) | ElectronNativeImage | Creates a new NativeImage instance from buffer that contains the raw bitmap pixel data returned by toBitmap(). The specific format is platform-dependent. | |
| createFromBuffer(buffer, options?) | ElectronNativeImage | Creates a new NativeImage instance from buffer. Tries to decode as PNG or JPEG first. | |
| createFromDataURL(dataURL) | ElectronNativeImage | Creates a new NativeImage instance from dataURL. | |
| createFromNamedImage(imageName, hslShift?) | ElectronNativeImage | Creates a new NativeImage instance from the NSImage that maps to the given image name. Only available on macOS. | |
| createFromPath(path) | ElectronNativeImage | Creates a new NativeImage instance from a file located at path. This method returns an empty image if the path does not exist, cannot be read, or is not a valid image. | |
| createThumbnailFromPath(path, maxSize) | Promise<ElectronNativeImage> | Creates a thumbnail preview image for the file at path. Only available on macOS and Windows. |
Links to this page: