VintaSoft Imaging .NET SDK 10.0
In This Topic
    Processing command features
    In This Topic

    Process multiple images using the same image processing command

    The same image processing command can be applied to multiple images.

    Here is an example that shows how to create an image processing command and apply it to 3 images:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    
    Dim command As New Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand(Brightness)
    command.ExecuteInPlace(image1)
    command.ExecuteInPlace(image2)
    command.ExecuteInPlace(image3)
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    
    Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand command = 
        new Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand(Brightness);
    command.ExecuteInPlace(image1);
    command.ExecuteInPlace(image2);
    command.ExecuteInPlace(image3);
    


    Proces image region

    The image processing command, which is derived from ProcessingCommandWithRegion class, has the ProcessingCommandWithRegion.RegionOfInterest property and can be applied not only to the specified image region.

    Here is an example that shows how to change brighntess in image region:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    
    Dim command As New Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand(Brightness)
    command.RegionOfInterest = New Vintasoft.Imaging.RegionOfInterest(selectedArea)
    command.ExecuteInPlace(image)
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    
    Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand command = 
        new Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand(Brightness);
    command.RegionOfInterest = new Vintasoft.Imaging.RegionOfInterest(selectedArea);
    command.ExecuteInPlace(image);
    


    Monitor image processing progress

    The image processing progress can be monitored using the ProcessingCommandBase.Started, ProcessingCommandBase.Progress, ProcessingCommandBase.Canceled and ProcessingCommandBase.Finished events. The ProcessingCommandBase.Started and ProcessingCommandBase.Progress events allows to stop the image processing.

    Here is an example that shows how to display the image processing progress:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    
    Public Sub ChangeBrightnessWithProgress()
            Dim command As New Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand(Brightness)
            AddHandler command.Progress, New System.EventHandler(Of Vintasoft.Imaging.ImageProcessing.ImageProcessingProgressEventArgs)(AddressOf command_Progress)
            command.ExecuteInPlace(image)
    End Sub
    
    Private Sub command_Progress(sender As Object, e As Vintasoft.Imaging.ImageProcessing.ImageProcessingProgressEventArgs)
            System.Console.WriteLine(e.Progress)
            e.Cancel = True
    End Sub
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    
    public void ChangeBrightnessWithProgress()
    {
        Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand command = 
            new Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand(Brightness);
        command.Progress += 
            new System.EventHandler<Vintasoft.Imaging.ImageProcessing.ImageProcessingProgressEventArgs>(command_Progress);
        command.ExecuteInPlace(image);
    }
    
    private void command_Progress(object sender, Vintasoft.Imaging.ImageProcessing.ImageProcessingProgressEventArgs e)
    {
        System.Console.WriteLine(e.Progress);
        e.Cancel = true;
    }
    


    Process the source image or create the source image clone before image procesing

    ProcessingCommandBase.ExecuteInPlace method processes the source image, i.e. does the "in-place" image processing.
    ProcessingCommandBase.Execute method creates the source image clone, processes cloned image and returns cloned image.


    Create custom image processing commands

    ProcessingCommandBase is the base class for all image processing commands. The custom image processing command can be created from scratch or by extending any existing processing command.