new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Electron · API · all subjects

nativeimage/overview

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

EXIF metadata support

EXIF metadata is currently not supported and will not be taken into account during image encoding and decoding.

nativeImage module overview

The nativeImage module provides a unified interface for manipulating system images for tray, dock, and application icons. It is available in both Main and Renderer processes. When calling this API from a renderer process with context isolation enabled, the API call must be placed in the preload script and exposed using the contextBridge API.

Supported image formats for nativeImage

PNG and JPEG image formats are supported across all platforms. PNG is recommended because of its support for transparency and lossless compression. On Windows, ICO icons can also be loaded from file paths.

Windows ICO icon recommended sizes

For Windows ICO icons, recommended sizes are: Small icon: 16x16 (100% DPI), 20x20 (125% DPI), 24x24 (150% DPI), 32x32 (200% DPI). Large icon: 32x32 (100% DPI), 40x40 (125% DPI), 48x48 (150% DPI), 64x64 (200% DPI), 256x256.

High resolution image naming convention

On platforms with high pixel density displays, append @2x after the image's base filename to mark it as a 2x scale high resolution image. Supported DPI suffixes are @1x, @1.25x, @1.33x, @1.4x, @1.5x, @1.8x, @2x, @2.5x, @3x, @4x, @5x.

macOS template image naming

On macOS, template images consist of black and an alpha channel. To mark an image as a template image, its base filename should end with the word Template (e.g. xxxTemplate.png). Template images can be specified at different DPI densities (e.g. xxxTemplate@2x.png).

nativeImage instance creation note

NativeImage is not exported from the 'electron' module. It is only available as a return value of methods in the Electron API.

Electron APIs accepting nativeImage or file paths

Electron APIs that take image files accept either file paths (strings) or NativeImage instances. An empty and transparent image will be used when null is passed.

Give your agent this brain