Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

flutter - resize asset image to dart ui image

Future<ui.Image> getUiImage(String imageAssetPath, int height, int width) async {
  final ByteData assetImageByteData = await rootBundle.load(imageAssetPath);
  final codec = await ui.instantiateImageCodec(
    assetImageByteData.buffer.asUint8List(),
    targetHeight: height,
    targetWidth: width,
  );
  final image = (await codec.getNextFrame()).image;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #flutter #resize #asset #image #dart #ui #image
ADD COMMENT
Topic
Name
4+1 =