小编Lov*_*ain的帖子

从画布保存后图像看起来模糊并且图像质量与颤振中的旧图像不同

//首先是我写的代码。

class  AreaPainter extends CustomPainter{
List<Offset> points;
bool clear;
bool iscrop;
final ui.Image image;
BuildContext context;
AreaPainter(@required this.image,@required  this.clear,@required this.points,@required  `this.iscrop,@required  this.context);`
  @override
  void paint(Canvas canvas, Size size) async {
    final paint = Paint()
      ..color = Colors.blue

      ..strokeCap = StrokeCap.square
      ..style = PaintingStyle.fill
      ..strokeWidth = 2;

  
    final ui.Rect rect = ui.Offset.zero & size;
    final Size imageSize = new Size(image.width.toDouble(), image.height.toDouble());

    FittedSizes sizes = applyBoxFit(BoxFit.cover, imageSize, size);

    // if you don't want it centered for some reason change this.
    final Rect …
Run Code Online (Sandbox Code Playgroud)

android ios flutter flutter-design

6
推荐指数
0
解决办法
598
查看次数

标签 统计

android ×1

flutter ×1

flutter-design ×1

ios ×1