/// <inheritdoc cref="ApplyConvolutionKernelEventArgs"/>
        public async Task OnEventHandler(object publisher, ApplyConvolutionKernelEventArgs e)
        {
            try
            {
                var filter = View.Dropdown;

                if (filter != ConvKernel.Unknown)
                {
                    var copy = await _locker.LockOperationAsync(
                        () => new Bitmap(ViewModel.Source)
                        ).ConfigureAwait(true);

                    Aggregator.PublishFromAll(publisher,
                                              new AttachBlockToRendererEventArgs(
                                                  block: new PipelineBlock(copy)
                                                  .Add <Bitmap, Bitmap>(
                                                      (bmp) => _provider.ApplyFilter(bmp, filter)
                                                      )
                                                  )
                                              );
                }
            }
            catch (Exception ex)
            {
                View.Tooltip(Errors.ApplyConvolutionFilter);
            }
        }
Exemplo n.º 2
0
 public virtual async Task OnEventHandler(object publisher, ApplyConvolutionKernelEventArgs e)
 {
 }