* [clipboard](api/clipboard.md)
* [crash-reporter](api/crash-reporter.md)
+* [native-image](api/native-image.md)
* [screen](api/screen.md)
* [shell](api/shell.md)
other windows
* `fullscreen` Boolean - Whether the window should show in fullscreen, when
set to `false` the fullscreen button would also be hidden on OS X
- * `skip-taskbar` Boolean - Do not show window in taskbar
+ * `skip-taskbar` Boolean - Do not show window in Taskbar
* `zoom-factor` Number - The default zoom factor of the page, zoom factor is
zoom percent / 100, so `3.0` represents `300%`
* `kiosk` Boolean - The kiosk mode
* `title` String - Default window title
- * `icon` [Image](image.md) - The window icon, when omitted on Windows the
- executable's icon would be used as window icon
+ * `icon` [NativeImage](native-image.md) - The window icon, when omitted on
+ Windows the executable's icon would be used as window icon
* `show` Boolean - Whether window should be shown when created
* `frame` Boolean - Specify `false` to create a
[Frameless Window](frameless-window.md)
* `skip` Boolean
-Makes the window do not show in taskbar.
+Makes the window do not show in Taskbar.
### BrowserWindow.setKiosk(flag)
### BrowserWindow.setOverlayIcon(overlay, description)
-* `overlay` [Image](image.md) - the icon to display on the bottom right corner of the Taskbar icon. If this parameter is `null`, the overlay is cleared.
-* `description` String - a description that will be provided to Accessibility screenreaders
+* `overlay` [NativeImage](native-image.md) - the icon to display on the bottom
+right corner of the Taskbar icon. If this parameter is `null`, the overlay is
+cleared
+* `description` String - a description that will be provided to Accessibility
+screen readers
Sets a 16px overlay onto the current Taskbar icon, usually used to convey some sort of application status or to passively notify the user.
* `title` String - Title of the message box, some platforms will not show it
* `message` String - Content of the message box
* `detail` String - Extra information of the message
- * `icon` [Image](image.md)
+ * `icon` [NativeImage](native-image.md)
* `callback` Function
Shows a message box, it will block until the message box is closed. It returns
-# Image
+# NativeImage
-In atom-shell images are represented by their file paths, we currently do not
-support in-memory images or remote images.
+In atom-shell for the APIs that take images, you can pass either file paths or
+`NativeImage` instances. When passing `null`, an empty image will be used.
For example when creating tray or setting window's icon, you can pass image's
file path as `String` to represent an image:
var window = new BrowserWindow({icon: '/Users/somebody/images/window.png'});
```
-## Supported formats
+Or read the image from clipboard:
-On Mac all formats supported by the system can be used, while on Linux and
-Windows only `PNG` and `JPG` formats are supported.
+```javascript
+var clipboard = require('clipboard');
+var image = clipboard.readImage();
+var appIcon = new Tray(image);
+```
-So it is recommended to use `PNG` images for all cases.
+## Supported formats
+
+Currently `PNG` and `JPEG` are supported, and it is recommended to use `PNG`
+because it supports alpha channel and image is usually not compressed.
## High resolution image
* `xxxTemplate.png`
* `xxxTemplate@2x.png`
+
+## nativeImage.createFromPng(buffer)
+
+* `buffer` [Buffer][buffer]
+
+Creates a new `NativeImage` instance from `buffer` with `PNG` format.
+
+## nativeImage.createFromPng(buffer)
+
+* `buffer` [Buffer][buffer]
+
+Creates a new `NativeImage` instance from `buffer` with `JPEG` format.
+
+## nativeImage.createFromPath(path)
+
+* `path` String
+
+Creates a new `NativeImage` instance from file located at `path`.
+
+## Class: NativeImage
+
+This class is used to represent an image.
+
+### NativeImage.toPng()
+
+Returns a [Buffer][buffer] that contains image's `PNG` encoded data.
+
+### NativeImage.isJpeg()
+
+Returns a [Buffer][buffer] that contains image's `JPEG` encoded data.
+
+### NativeImage.isEmpty()
+
+Returns whether the image is empty.
+
+### NativeImage.getSize()
+
+Returns the size of the image.
+
+[buffer]: https://iojs.org/api/buffer.html#buffer_class_buffer
### new Tray(image)
-* `image` [Image](image.md)
+* `image` [NativeImage](native-image.md)
Creates a new tray icon associated with the `image`.
### Tray.setImage(image)
-* `image` [Image](image.md)
+* `image` [NativeImage](native-image.md)
Sets the `image` associated with this tray icon.
### Tray.setPressedImage(image)
-* `image` [Image](image.md)
+* `image` [NativeImage](native-image.md)
Sets the `image` associated with this tray icon when pressed.
### Tray.displayBalloon(options)
* `options` Object
- * `icon` [Image](image.md)
+ * `icon` [NativeImage](native-image.md)
* `title` String
* `content` String