getRenderableImage method
- Size? size,
- ImageFileFormat format = ImageFileFormat.png,
- SignpostImageRenderSettings? renderSettings,
- bool allowResize = false,
override
Get the image data as a RenderableImg. A RenderableImg contains the Uint8List and its width and height.
Parameters
- IN size The image size as (width, height). By default the SdkSettings.getDefaultWidthHeightImageFormat.size is used
- IN format The image format. By default it is PNG.
- IN renderSettings The render settings to be used.
- IN allowResize If false then the given
size
will be used to render the image. If true then the SDK might choose a suitable size based on the height of thesize
. By default it is false.
Returns
- The image as a RenderableImg if the image isValid, null otherwise.
Implementation
@override
RenderableImg? getRenderableImage({
Size? size,
ImageFileFormat format = ImageFileFormat.png,
SignpostImageRenderSettings? renderSettings,
bool allowResize = false,
}) {
renderSettings ??= const SignpostImageRenderSettings();
return GemKitPlatform.instance.callGetFlutterImg(
_pointerId,
size != null ? size.width.toInt() : -1,
size != null ? size.height.toInt() : -1,
format.id,
arg: jsonEncode(renderSettings),
allowResize: allowResize,
);
}