getPixel(x, y, out) → {object}
Get the color of a specific pixel in the context into a color object.
If you have drawn anything to the BitmapData since it was created you must call BitmapData.update to refresh the array buffer,
otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist.
Parameters
Name | Type | Argument | Description |
---|---|---|---|
x | number | The x coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData. | |
y | number | The y coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData. | |
out | object | <optional> | An object into which 4 properties will be created: r, g, b and a. If not provided a new object will be created. |
Returns
An object with the red, green, blue and alpha values set in the r, g, b and a properties.
- Source code: gameobjects/BitmapData.js (Line 985)
Please login to continue.