getRenderableImage method
RenderableImg?
getRenderableImage({
- Size? size,
- ImageFileFormat format = ImageFileFormat.png,
- Color backgroundColor = Colors.transparent,
- bool allowResize = false,
override
Retrieves image with bytes and actual rendered dimensions.
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
- RenderableImg containing bytes, width, and height, or null if invalid
See also:
- getRenderableImageBytes - Returns only raw image bytes as Uint8List
Implementation
@override
RenderableImg? getRenderableImage({
Size? size,
ImageFileFormat format = ImageFileFormat.png,
Color backgroundColor = Colors.transparent,
bool allowResize = false,
}) {
final Rgba bgColor = backgroundColor.toRgba();
return GemKitPlatform.instance.callGetFlutterImg(
pointerId,
size != null ? size.width.toInt() : -1,
size != null ? size.height.toInt() : -1,
format.id,
arg: jsonEncode(bgColor),
allowResize: allowResize,
);
}