←Select platform

AutoFormsParallelRunResultRasterImageCallback(RasterImage,AutoFormsRunResult,int,object) Delegate

Summary

Callback used to retrieve the result from the AutoFormsEngine for a RasterImage instance.

Syntax

C#
C++/CLI
Python
public delegate void AutoFormsParallelRunResultRasterImageCallback( 
   RasterImage image, 
   AutoFormsRunResult result, 
   int itemIndex, 
   object userData 
) 
public: 
   delegate void AutoFormsParallelRunResultRasterImageCallback( 
      RasterImage^ image, 
      AutoFormsRunResult^ result, 
      Int32 itemIndex, 
      Object^ userData 
   ) 
def AutoFormsParallelRunResultRasterImageCallback(self,image,result,itemIndex,userData): 
# image : RasterImage, result : AutoFormsRunResult, itemIndex : Int32, userData : Object 

Parameters

image

The RasterImage instance that was just processed.

result

The AutoFormsRunResult instance that contains the result.

itemIndex

The index of the processed item.

userData

The custom value obtained from either the on-demand getter method, or from the itemsUserData list.

Example

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Forms.Common; 
using Leadtools.Forms.Auto; 
using Leadtools.Document; 
using Leadtools.Ocr; 
using Leadtools.Forms.Recognition; 
using Leadtools.Forms.Processing; 
using Leadtools.Barcode; 
 
using Leadtools.Forms; 
 
 
void ResultCallbackImage(RasterImage image, AutoFormsRunResult result, int itemIndex, object label) 
{ 
   if (result == null) 
   { 
      Console.WriteLine($"ERROR!!!: Failed to process {label}: [{itemIndex}]"); 
   } 
   else 
   { 
      Console.WriteLine($"Successfully processed {label}: [{itemIndex}]"); 
      foreach (FormPage page in result.FormFields) 
      { 
         foreach (FormField field in page) 
         { 
            Console.WriteLine($"Process for the field {field.Name} is {field.Result.Status} "); 
         } 
      } 
   } 
} 
 
void ProcessFormsMultiProcessListImages(AutoFormsEngine autoEngine, List<string> fileNames, List<string> repositoryNames) 
{ 
   var codecs = new RasterCodecs(); 
   List<string> labels = fileNames.Select(fn => fn.Split('/', '\\').Last()).ToList(); 
   List<object> labels_AsCustomDataList = labels.Select(label => label as object).ToList(); 
   List<RasterImage> images = fileNames.Select(fn => codecs.Load(fn)).ToList(); 
 
   autoEngine.RunParallelPipesForList( 
       images, 
       ResultCallbackImage, 
       labels_AsCustomDataList, 
       repositoryNames, 
       8 
   ); 
 
   codecs.Dispose(); 
} 

Requirements

Target Platforms

See Also

Leadtools.Forms.Auto Namespace

RunParallelPipesOnDemand

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Forms.Auto Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.