getRenderableImage method

RenderableImg? getRenderableImage({
  1. Size? size,
  2. ImageFileFormat format = ImageFileFormat.png,
})

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 size
  • format - Desired image format (default: ImageFileFormat.png)

Returns

See also:

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,
  );
}