loadUint8ListByImage method

Future<Uint8List?> loadUint8ListByImage(
  1. Image image
)

通过ui.Image获取图片

Implementation

Future<Uint8List?> loadUint8ListByImage(ui.Image image) async {
  var byteData = await image.toByteData(format: ui.ImageByteFormat.png);
  return byteData?.buffer.asUint8List();
}