|
|
@@ -112,7 +112,7 @@ class _ShareAlertSelectState extends State<ShareAlertSelect> { |
|
|
|
RenderRepaintBoundary boundary = buildContext.findRenderObject(); |
|
|
|
|
|
|
|
///pixelRatio是放大倍数 |
|
|
|
ui.Image image = await boundary.toImage(pixelRatio: 3); |
|
|
|
ui.Image image = await boundary.toImage(pixelRatio: 5); |
|
|
|
// 注意:png是压缩后格式,如果需要图片的原始像素数据,请使用rawRgba |
|
|
|
ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png); |
|
|
|
Uint8List pngBytes = byteData.buffer.asUint8List(); |
|
|
@@ -381,7 +381,7 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { |
|
|
|
} |
|
|
|
|
|
|
|
if (_shareDataModel?.poster != null) { |
|
|
|
File file = await EncodeUtil.compressImage(context, images: _shareDataModel?.poster, size: 400); |
|
|
|
File file = await EncodeUtil.compressImage(context, images: _shareDataModel?.poster, size: 500); |
|
|
|
_shareDataModel.poster = file.readAsBytesSync(); |
|
|
|
Loading.dismiss(); |
|
|
|
} |
|
|
|