imageFilter property

ImageFilter imageFilter

The ImageFilter to use when drawing raster images.

For example, to blur an image using Canvas.drawImage, apply an ImageFilter.blur:

import 'dart:ui' as ui;

ui.Image image;

void paint(Canvas canvas, Size size) {
  canvas.drawImage(
    image,
    Offset.zero,
    Paint()..imageFilter = ui.ImageFilter.blur(sigmaX: .5, sigmaY: .5),
  );
}

See also:

Implementation

ImageFilter get imageFilter {
  if (_objects == null)
    return null;
  return _objects[_kImageFilterIndex];
}
void imageFilter= (ImageFilter value)

Implementation

set imageFilter(ImageFilter value) {
  _objects ??= List<dynamic>(_kObjectCount);
  _objects[_kImageFilterIndex] = value;
}