nashaofu / node-screenshots

Zero-dependent. A native nodejs screenshots library for Mac、Windows、Linux.
Apache License 2.0
301 stars 11 forks source link

在Electron22.0.0版本无法运行 #43

Closed nymlc closed 1 month ago

nymlc commented 2 months ago
image
nashaofu commented 1 month ago
export class Image {
  readonly width: number
  readonly height: number
  cropSync(x: number, y: number, width: number, height: number): Image
  crop(x: number, y: number, width: number, height: number): Promise<Image>
  toPngSync(copyOutputData?: boolean | undefined | null): Buffer
  toPng(copyOutputData?: boolean | undefined | null): Promise<Buffer>
  toJpegSync(copyOutputData?: boolean | undefined | null): Buffer
  toJpeg(copyOutputData?: boolean | undefined | null): Promise<Buffer>
  toBmpSync(copyOutputData?: boolean | undefined | null): Buffer
  toBmp(copyOutputData?: boolean | undefined | null): Promise<Buffer>
  toRawSync(copyOutputData?: boolean | undefined | null): Buffer
  toRaw(copyOutputData?: boolean | undefined | null): Promise<Buffer>
}

在electron 里面 copyOutputData 传true

nashaofu commented 1 month ago

https://github.com/nashaofu/node-screenshots/blob/master/README-zh_CN.md#image