getRenderableImage method
Retrieves image data with both bytes and actual rendered dimensions.
Returns a RenderableImg containing the image bytes plus the final width
and height produced by the SDK. Use when you need to know the actual rendered
size, especially with vector images or when using allowResize in subclasses.
Parameters
size- Optional desired image size (width, height). If omitted, uses SDK-recommended sizeformat- Desired image format (default: ImageFileFormat.png)
Returns
- RenderableImg with bytes and dimensions if isValid is true, null otherwise
See also:
- getRenderableImageBytes - Returns only raw bytes without dimensions
Implementation
RenderableImg? getRenderableImage({
Size? size,
ImageFileFormat format = ImageFileFormat.png,
}) {
return GemKitPlatform.instance.callGetFlutterImg(
pointerId,
size != null ? size.width.toInt() : -1,
size != null ? size.height.toInt() : -1,
format.id,
allowResize: false,
);
}