copyRect method

PCanvasPixels? copyRect(
  1. int x,
  2. int y,
  3. int width,
  4. int height,
)

Implementation

PCanvasPixels? copyRect(int x, int y, int width, int height) {
  if (width <= 0 || height <= 0) return null;

  var rect = createBlank(width, height);
  rect.setPixelsRectFrom(this, x, y, 0, 0, width, height);
  return rect;
}