| nativeImage.createEmpty() |
返回 NativeImage,创建一个空图像实例。 |
支持 |
| nativeImage.createThumbnailFromPath(path, size) |
返回 Promise,以文件的缩略图预览图像 fulfill。 |
不支持 |
| nativeImage.createFromPath(path) |
返回 NativeImage,从指定路径创建图像实例。 |
支持 |
| nativeImage.createFromBitmap(buffer, options) |
返回 NativeImage,从原始位图数据创建图像实例。 |
支持 |
| nativeImage.createFromBuffer(buffer[, options]) |
返回 NativeImage,从 Buffer 创建图像实例。 |
支持 |
| nativeImage.createFromDataURL(dataURL) |
返回 NativeImage,从 Data URL 创建图像实例。 |
支持 |
| nativeImage.createFromNamedImage(imageName[, hslShift]) |
返回 NativeImage,从 macOS 系统命名图像创建实例。 |
不支持 |
| image.toPNG([options]) |
返回 Buffer,包含图像的 PNG 编码数据。 |
支持 |
| image.toJPEG(quality) |
返回 Buffer,包含图像的 JPEG 编码数据。 |
支持 |
| image.toBitmap([options]) |
返回 Buffer,包含图像原始位图像素数据的副本。 |
支持 |
| image.toDataURL([options]) |
返回 string,即图像的 Data URL。 |
支持 |
| image.getBitmap([options]) |
返回 Buffer,包含图像的原始位图像素数据。 |
支持 |
| image.getNativeHandle() |
返回 Buffer,存储指向底层原生句柄的 C 指针。 |
不支持 |
| image.isEmpty() |
返回 boolean,表示图像是否为空。 |
支持 |
| image.getSize([scaleFactor]) |
返回 Size,即图像的尺寸。 |
支持 |
| image.setTemplateImage(option) |
将图像标记为 macOS 模板图像。 |
支持 |
| image.isTemplateImage() |
返回 boolean,表示图像是否为 macOS 模板图像。 |
支持 |
| image.crop(rect) |
返回 NativeImage,即裁剪后的图像。 |
支持 |
| image.resize(options) |
返回 NativeImage,即缩放后的图像,质量可选 good、better 或 best,默认为 best。 |
支持 |
| image.getAspectRatio([scaleFactor]) |
返回 Number,即图像的宽高比(宽除以高)。 |
支持 |
| image.getScaleFactors() |
返回 Number[],即该 NativeImage 所有表示形式对应的缩放因子数组。 |
支持 |
| image.addRepresentation(options) |
添加指定缩放因子的图像表示,buffer 用于指定原始图像数据。 |
支持 |