resizeImage function
Resizes an Image to the specified dimensions.
Parameters:
- image: The source
Imageto resize - width: The target width in pixels
- height: The target height in pixels
Returns a Future that completes with the resized Image.
Implementation
Future<Image> resizeImage(Image image, int width, int height) async {
final codec = await instantiateImageCodec(
await encodePng(image),
targetWidth: width,
targetHeight: height
);
return (await codec.getNextFrame()).image;
}