setPixelAt method

void setPixelAt(
  1. int x,
  2. int y,
  3. Rgb565 pixel
)

Set the RGB pixel at the given coordinate.

The origin is the top left corner. Indices are zero-based.

Implementation

void setPixelAt(int x, int y, Rgb565 pixel) {
  (x, y) = (y, x);
  final index = _memoryIndex(x, y);
  buffer.setUint16(index * _bytesPerPixel, pixel.toInt(), endianness);
}