ImageGear for .NET
ImGearRecProgressEventHandler Delegate
See Also  Example Send Feedback
ImageGear21.Recognition Assembly > ImageGear.Recognition Namespace : ImGearRecProgressEventHandler Delegate




sender
Event sender (ImGearRecognition object).
e
ImGearRecProgressEventArgs value.

Glossary Item Box

This is the delegate used to pass ImGearRecognition.Progress events on to an application event handler.

Syntax

 
Visual Basic
C#
Managed Extensions for C++
C++/CLI
 
 

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

C#Copy Code
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);
    }
}
Visual BasicCopy Code
Public Delegate Sub UpdateProgressBarDelegate(ByVal e As ImGearRecProgressEventArgs)
Public progressDelegate As UpdateProgressBarDelegate

Sub UpdateProgressBar(ByVal e As ImGearRecProgressEventArgs)
    If e.Percent < 100 Then
        toolStripStatusProgress.Text = e.Process.ToString() + " - " + e.Percent.ToString() + "%"
    Else
        toolStripStatusProgress.Text = "Ready"
    End If
    Me.Update()
End Sub

Private Sub recProgress(ByVal sender As Object, ByVal e As ImGearRecProgressEventArgs)
    If Me.InvokeRequired Then
        Dim arg As Object() = New Object(0) {}
        arg(0) = e
        Me.Invoke(progressDelegate, arg)
    Else
        UpdateProgressBar(e)
    End If
End Sub

See Also

©2013. Accusoft Corporation. All Rights Reserved.