PCanvasBitmap constructor

PCanvasBitmap(
  1. int width,
  2. int height,
  3. PCanvasPainter painter, {
  4. PCanvasPixels? initialPixels,
})

Implementation

PCanvasBitmap(this.width, this.height, this.painter,
    {PCanvasPixels? initialPixels})
    : super.impl() {
  _bitmap = img.Image(
      width: width,
      height: height,
      format: img.Format.uint8,
      numChannels: 4,
      withPalette: false);

  if (initialPixels != null) {
    setPixels(initialPixels);
  }

  painter.callLoadResources(this);
}