[flutter]我无法在Paint中使用BlendMode.srcIn

时间:2019-02-20 02:59:47

标签: flutter paint

我想用油漆来实现ClipRRect之类的效果。

class SignaturePainter extends CustomPainter {
  ...
  void paint(Canvas canvas, Size size) {
    Paint paint = new Paint()..color = Colors.blue[200];
    canvas.drawImageRect(image,Rect.fromLTWH(0, 0, image.width.toDouble(), image.height.toDouble()),Rect.fromLTWH(0, 0, 400,400),paint);
    paint.blendMode = BlendMode.srcIn;
    canvas.drawCircle(Offset(200, 200), 50, paint);
  }
}

BlendMode.srcIn似乎不起作用,但是如果我将BlendMode更改为BlendMode的其他值,那么它可以工作,如何解决?我的设备是Nokia7 Plus。

0 个答案:

没有答案