Pārlūkot izejas kodu

1.调整分享的图片大小

tags/0.013+9
“yanghuaxuan” pirms 3 gadiem
vecāks
revīzija
1fdb79b410
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. +1
    -1
      lib/widgets/share/share_alert_select.dart

+ 1
- 1
lib/widgets/share/share_alert_select.dart Parādīt failu

@@ -112,7 +112,7 @@ class _ShareAlertSelectState extends State<ShareAlertSelect> {
RenderRepaintBoundary boundary = buildContext.findRenderObject();

///pixelRatio是放大倍数
ui.Image image = await boundary.toImage(pixelRatio: 5);
ui.Image image = await boundary.toImage(pixelRatio: 3);
// 注意:png是压缩后格式,如果需要图片的原始像素数据,请使用rawRgba
ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png);
Uint8List pngBytes = byteData.buffer.asUint8List();


Notiek ielāde…
Atcelt
Saglabāt