Leadtools.Forms Namespace : FormProgressCallback Delegate |
public delegate bool FormProgressCallback( int currentPage, int totalPages, int percentage )
'Declaration Public Delegate Function FormProgressCallback( _ ByVal currentPage As Integer, _ ByVal totalPages As Integer, _ ByVal percentage As Integer _ ) As Boolean
'Usage Dim instance As New FormProgressCallback(AddressOf HandlerMethod)
public delegate bool FormProgressCallback( int currentPage, int totalPages, int percentage )
FormProgressCallback( currentPage , totalPages , percentage )
public delegate bool FormProgressCallback( int currentPage, int totalPages, int percentage )
Public Function ProgressCallbackExample(ByVal recognitionEngine As FormRecognitionEngine, ByVal master As FormRecognitionAttributes, _ ByVal form As FormRecognitionAttributes) As FormRecognitionResult Return recognitionEngine.CompareForm(master, form, AddressOf MyFormProgressCallback, AddressOf MyPageProgressCallback) End Function Private Sub MyPageProgressCallback(ByVal data As PageProgressCallbackData) If data.Percentage = 0 Then Console.WriteLine("--------------------------") End If Console.WriteLine("Page progress:{0}%", data.Percentage.ToString("000")) End Sub Private Function MyFormProgressCallback(ByVal currentPage As Integer, ByVal totalPages As Integer, ByVal percentage As Integer) As Boolean If percentage = 0 Then Console.WriteLine("--------------------------") End If Console.WriteLine("Page:{0}/{1} {2}%", currentPage.ToString("00"), totalPages.ToString("00"), percentage.ToString("000")) Return False End Function
// Text writer to save the log to public FormRecognitionResult ProgressCallbackExample(FormRecognitionEngine recognitionEngine, FormRecognitionAttributes master, FormRecognitionAttributes form) { return recognitionEngine.CompareForm(master, form, MyFormProgressCallback, MyPageProgressCallback); } private void MyPageProgressCallback(PageProgressCallbackData data) { if(data.Percentage == 0) Console.WriteLine("--------------------------"); Console.WriteLine("Page progress:{0}%", data.Percentage.ToString("000")); } private bool MyFormProgressCallback(int currentPage, int totalPages, int percentage) { if(percentage == 0) Console.WriteLine("--------------------------"); Console.WriteLine("Page:{0}/{1} {2}%", currentPage.ToString("00"), totalPages.ToString("00"), percentage.ToString("000")); return false; }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2