

The Windows implementation will ignore maxSize.height and scale the height according to maxSize.width. maxSize Size - the maximum width and height (positive numbers) the thumbnail returned can be.path string - path to a file that we intend to construct a thumbnail out of.nativeImage.createThumbnailFromPath(path, maxSize) macOS Windows The nativeImage module has the following methods, all of which returnĪn instance of the NativeImage class: nativeImage.createEmpty() Ĭreates an empty NativeImage instance. To mark an image as a template image, its filename should end with the word Note: Template image is only supported on macOS. The most common case is to use template images for a menu bar icon, so it can Mixed with other content to create the desired final appearance. Template images are not intended to be used as standalone images and are usually Template images consist of black and an alpha channel. The following suffixes for DPI are also supported:

You can put images with different sizes in the same folder and use the filename If you want to support displays with different DPI densities at the same time,

On platforms that have high-DPI support such as Apple Retina displays, you canĪppend after image's base filename to mark it as a high resolution image.įor example, if icon.png is a normal image that has standard resolution, will be treated as a high resolution image that has double DPI Quality, it is recommended to include at least the following sizes in the:Ĭheck the Size requirements section in this article. On Windows, you can also load ICO icons from file paths. PNG is recommendedīecause of its support for transparency and lossless compression. Currently PNG and JPEG image formats are supported.
