copyPixels method

void copyPixels(
  1. BitmapData source,
  2. Rectangle<num> sourceRect,
  3. Point<num> destPoint
)

Copy pixels from source, completely replacing the pixels at destPoint.

copyPixels erases the target location specified by destPoint and sourceRect, then draws over it.

NOTE: drawPixels is more performant.

Implementation

void copyPixels(
    BitmapData source, Rectangle<num> sourceRect, Point<num> destPoint) {
  final updateBatch = BitmapDataUpdateBatch(this);
  updateBatch.copyPixels(source, sourceRect, destPoint);
  updateBatch.update();
}