loadImageByUint8List method

Future<Image> loadImageByUint8List(
  1. Uint8List list, {
  2. int? width,
  3. int? height,
})

通过Uint8List获取图片

Implementation

Future<ui.Image> loadImageByUint8List(
  Uint8List list, {
  int? width,
  int? height,
}) async {
  ui.Codec codec = await ui.instantiateImageCodec(list,
      targetWidth: width, targetHeight: height);
  ui.FrameInfo frame = await codec.getNextFrame();
  return frame.image;
}