PictureEffects Xojo Plugin |

# ConvolutionEffect.ApplyMatrix Method

To apply a custom 3x3 Matrix to a picture use the ApplyMatrix function

ApplyMatrix(
source as Picture,
matrix as ConvolutionMatrix,
mask as Picture) as Picture

#### Parameters

source
  The source picture to work with. This picture has to be 32 bits per pixel.
matrix
  A custom matrix to apply. This class must be of the type ConvolutionMatrix which is defined in this plugin.
mask
  To limit the filtering to certain pixels then set a picture defining the mask to this parameter. Pass nil to this parameter if the filtering should not be limited to certain pixels.
  The mask picture must be a 32 bit picture and must be same size or larger than the src picture. If the mask picture is not 32 bits and at least the same size as the src picture then the function will fail and leave the result picture unchanged.

#### Returns

Picture
  If the filter was successful: A reference to the modified picture.
  If nil was returned then see the ErrorCode property to get hints for cause of the error.

#### Remarks

This is a pro feature, we cannot provide any support to explain the science behind matrixes, it is a subject for a full university course. For those who want to study the science behind graphics filter matrixes Google is probably one of the best place to start, the net is full of info and articles about this.

#### See Also

ConvolutionEffect Class