I used ImageShader and used shader property of Paint Function
device transform is used to get the device pixel so that it can render the effect
This is my paint method look like...
final double devicePixelRatio = ui.window.devicePixelRatio;
@override
void paint(Canvas canvas, Size size) {
final Float64List deviceTransform = new Float64List(16)
..[0] = devicePixelRatio
..[5] = devicePixelRatio
..[10] = 1.0
..[15] = 2.0;
Float64List matrix = new Float64List(16);
print('matrix is $matrix');
print('image is coming in paint $image');
Paint paint = new Paint()
..style = PaintingStyle.stroke
..strokeCap = StrokeCap.round
..shader = ImageShader(
image, TileMode.repeated, TileMode.repeated, deviceTransform)
..strokeWidth = 40.2;
paths.forEach((path) {
canvas.drawPath(path, paint);
});
repaint = false;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…