BitmapData constructor

BitmapData(
  1. num width,
  2. num height,
  3. [int fillColor = 0xFFFFFFFF,
  4. num pixelRatio = 1.0]
)

Implementation

factory BitmapData(num width, num height,
    [int fillColor = 0xFFFFFFFF, num pixelRatio = 1.0]) {
  final textureWidth = (width * pixelRatio).round();
  final textureHeight = (height * pixelRatio).round();
  final renderTexture = RenderTexture(textureWidth, textureHeight, fillColor);
  final renderTextureQuad = renderTexture.quad.withPixelRatio(pixelRatio);
  return BitmapData.fromRenderTextureQuad(renderTextureQuad);
}