decodePng function

Future decodePng(
  1. Uint8List bytes
)

Decodes a PNG image from a byte array into an Image object.

Parameters:

Returns a Future that completes with the decoded Image.

Implementation

Future<Image> decodePng(Uint8List bytes) async {
  final codec = await instantiateImageCodec(bytes);
  return (await codec.getNextFrame()).image;
}