rlReadScreenPixels function

Uint8List rlReadScreenPixels(
  1. int width,
  2. int height
)

Implementation

Uint8List rlReadScreenPixels(int width, int height) {
  final ptr = raylib.rlReadScreenPixels(width, height);
  final size = width * height * 4; // RGBA
  final result = Uint8List.fromList(ptr.cast<Uint8>().asTypedList(size));
  ffi.malloc.free(ptr);
  return result;
}