ImageGear .NET - Updated December 24, 2018
ImGearRecProgressEventHandler Delegate
ExampleExample 




ImageGear24.Recognition Assembly > ImageGear.Recognition Namespace : ImGearRecProgressEventHandler Delegate
Event sender (ImGearRecognition object).
ImGearRecProgressEventArgs value.
This is the delegate used to pass ImGearRecognition.Progress events on to an application event handler.
Syntax
'Declaration
 
Public Delegate Sub ImGearRecProgressEventHandler( _
   ByVal sender As Object, _
   ByVal e As ImGearRecProgressEventArgs _
) 
 
'Usage
 
Dim instance As New ImGearRecProgressEventHandler(AddressOf HandlerMethod)

Parameters

sender
Event sender (ImGearRecognition object).
e
ImGearRecProgressEventArgs value.
Remarks
It follows the standard .NET event model. The ImGearRecognition.Progress event occurs during recognition processes. It indicates which recognition process is being performed, its percent completion, and gives the application a means of aborting the current recognition process.

Here’s an example of typical ImGearRecognition.Progress event registration and declaration:

Example
public delegate void UpdateProgressBarDelegate(ImGearRecProgressEventArgs e);
UpdateProgressBarDelegate progressDelegate = null;

void UpdateProgressBar(ImGearRecProgressEventArgs e)
{
    if (e.Percent < 100)
        toolStripStatusProgress.Text = e.Process + " - " + e.Percent + "%";
    else
        toolStripStatusProgress.Text = "Ready";
    this.Update();
}

private void recProgress(object sender, ImGearRecProgressEventArgs e)
{
    if(this.InvokeRequired)
    {
        object[] arg = new object[1];
        arg[0] = e;
        this.Invoke(progressDelegate, arg);
    }
    else
    {
        UpdateProgressBar(e);
    }
}
See Also

Reference

ImGearRecProgressEventHandler Members
ImageGear.Recognition Namespace
ImGearRecProgressEventArgs Class