getRenderableImageBytes method
Uint8List?
getRenderableImageBytes({
- Size? size,
- ImageFileFormat format = ImageFileFormat.png,
- Color backgroundColor = Colors.transparent,
- bool allowResize = false,
override
Retrieves image bytes suitable for display with Image.memory.
Convenience method that returns only the raw bytes without dimensions. Internally calls getRenderableImage and extracts the bytes.
Parameters
size- Optional desired dimensions (width/height in pixels). If omitted, uses SDK recommended sizeformat- Output format (default: ImageFileFormat.png)backgroundColor- Background color (default: Colors.transparent)allowResize- When true, SDK chooses optimal width based on height; when false, uses exact size (default: false)
Returns
See also:
- getRenderableImage - Returns RenderableImg with bytes and dimensions
Implementation
@override
Uint8List? getRenderableImageBytes({
Size? size,
ImageFileFormat format = ImageFileFormat.png,
Color backgroundColor = Colors.transparent,
bool allowResize = false,
}) {
return getRenderableImage(
size: size,
format: format,
backgroundColor: backgroundColor,
allowResize: allowResize,
)?.bytes;
}