Creates a new mouse cursor image with the give image data.
The array containing the image data.
Optional start offset within the array. Defaults to 0.
Protected ReadonlyheightThe image height in pixels.
Protected ReadonlywidthThe image width in pixels.
Draws the image onto the given rendering context.
The rendering context to draw the image to.
Optional horizontal target position. Defaults to 0.
Optional vertical target position. Defaults to 0.
Returns the RGBA color at the specified position.
The horizontal pixel position.
The vertical pixel position.
The RGBA color at the specified position.
RangeError if coordinates are outside of the image boundaries.
The image height in pixels.
The image width in pixels.
Resets the given canvas to the image size and fills the canvas with the image. This does not create a new canvas so any canvas implementation can be used and existing canvas objects can be re-used.
In a browser you do this:
const canvas = image.toCanvas(document.createElement("canvas"))`;
In Node.js (with node-canvas) you do this:
import { createCanvas} from "canvas";
const canvas = image.toCanvas(createCanvas());
The canvas to reset and fill.
The passed canvas for method chaining.
Copies the opaque pixels of this image into the given image data and returns the modified image data.
The image data to copy the opaque pixels of this image to.
The image data.
Container for a single mouse cursor image.