BitmapData constructor
BitmapData(
- num width,
- num height,
- [int fillColor = 0xFFFFFFFF,
- 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);
}