An open API service indexing awesome lists of open source software.

https://github.com/felladrin/windows-cursor-icon

Use Node.js to extract the image from Windows OS cursor: https://npm.im/windows-cursor-icon
https://github.com/felladrin/windows-cursor-icon

npm-package

Last synced: 7 months ago
JSON representation

Use Node.js to extract the image from Windows OS cursor: https://npm.im/windows-cursor-icon

Awesome Lists containing this project

README

          

# Windows Cursor Icon

Get the Windows cursor icon in different image formats.

## Install

```
npm i windows-cursor-icon
```

## Usage

```js
const { getCursorIcon, ImageFormat } = require("windows-cursor-icon");

const cursorIcon = getCursorIcon({ imageFormat: ImageFormat.Png });

console.log(cursorIcon);
// Prints:
// {
// hasChanged: true,
// isHidden: false,
// id: 65541,
// buffer: ,
// imageFormat: 'Png',
// xHotspot: 8,
// yHotspot: 9
// }

// The icon is in buffer, so it can be saved to a file, for example:
require("fs").writeFileSync("cursorIcon.png", cursorIcon.buffer);
```

Check [more examples here](./examples)!