Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.6k views
in Technique[技术] by (71.8m points)

flutter - Image clipped outside the height and width

I am trying to generate an image from Picture rendered from Canvas. When I apply height and width then this image clipped and particular area generated. I want to resize the over all image and generate file from this.

Here is my code:

//Generate Thumbnail
ui.Image thumbnail = await picture.toImage(200, 120,);
ByteData thumbByteData = await thumbnail.toByteData(format: ui.ImageByteFormat.png, );
Uint8List thumbBytes = thumbByteData.buffer.asUint8List();

final resultThumbnail = await ImageGallerySaver.saveImage(
  Uint8List.fromList(thumbBytes)
  quality: 100,
  name: "${DateTime.now().millisecondsSinceEpoch}",
  isReturnImagePathOfIOS: true,
);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...