📌  相关文章
📜  自定义标记大小谷歌地图颤动 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:57.406000             🧑  作者: Mango

代码示例2
import 'dart:ui' as ui;

Future getBytesFromAsset(String path, int width) async {
  ByteData data = await rootBundle.load(path);
  ui.Codec codec = await ui.instantiateImageCodec(data.buffer.asUint8List(), targetWidth: width);
  ui.FrameInfo fi = await codec.getNextFrame();
  return (await fi.image.toByteData(format: ui.ImageByteFormat.png)).buffer.asUint8List();
}