I have these two images
What I want to do is to xor them to get this image:
I have tried to do it using CustomPaint and setting BlendMode to XOR But it gives me a black screen
Here's the code I used:
class XorPainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) async {
if (imageA != null && imageB != null) {
canvas.drawImage(imageA, Offset.zero, Paint());
canvas.save();
canvas.drawImage(
imageB, Offset.zero, Paint()..blendMode = BlendMode.xor);
canvas.restore();
}
}
@override
bool shouldRepaint(CustomPainter oldDelegate) {
return true;
}
For more information: see this