ClearCleck21 MICR Reader Send comments on this topic.
ExtractCheck Method
See Also  Example

Description

Locate and MICR line anywhere on an image.  Extract identified type of the document image:  personal or business check, IRD.    Rotate and deskew if needed.

Syntax

Visual Basic
Public Function ExtractCheck() As ICiImage

Return Type

CiImage object.   See CiImage reference in Inlite's ClearImage COM Server help.
null or Nothing if no MICR line is found.

Remarks

If check is detected MicrLine(1) property contain MICR line information.
MicrLine(1).Document property contains check image geomtrical information.  

Example

In VB project Add Reference to ClearCheck21 MICR Reader and ClearImage COM Server
Visual BasicCopy Code
Private Sub ExtractToFile (file As String, page As Integer, fileOut As String)
  Dim reader As New CcMicrReader
  Dim checkImage As CiImage
  reader.Image.Open file, 1
  Set checkImage = reader.ExtractCheck
  If (Not checkImage Is Nothing) Then
    checkImage.SaveAs fileOut
    ' To obtain check image geometrical information
    ' Position: reader.MicrLine(1).Document.Left, reader.MicrLine(1).Document.Top, reader.MicrLine(1).Document.Right, reader.MicrLine(1).Document.Bottom
    ' Skew: reader.MicrLine(1).Document.Skew
    ' Rotation: Choose(reader.MicrLine(1).Document.Conf, "None", "Upside Down", "Left", "Right", "Unknown")
  End If
End Sub
In C# project Add Reference -> COM Tab -> ClearCheck21 MICR Reader and ClearImage COM Server
C#Copy Code
static System.Threading.Mutex mut =  new System.Threading.Mutex();    // Prevents reentrancy 
String[] rotText = {"", "None", "Upside Down", "Left", "Right", "Unknown"};  
 
public static void ExtractToFile (string file, int page, string fileOut) 

    try  
    {  
    mut.WaitOne();       
    ClearMicr.CcMicrReader reader = new ClearMicr.CcMicrReader(); 
    reader.Image.Open(file, page);  
    ClearImage.CiImage checkImage = reader.ExtractCheck(); 
    if (checkImage != null) 
      { 
      checkImage.SaveAs (fileOut, ClearImage.EFileFormat.ciTIFF); 
        // To obtain check image geometrical information 
      ClearMicr.CcMicrInfo Info = reader.get_MicrLine(i).Document; 
      String s = String.Format("Document at {0}:{1}-{2}:{3}  Skew: {4:F}deg   Rotation: {5}", 
             Info.Left, Info.Top, Info.Right, Info.Bottom, Info.Skew,  rotText[(int)Info.Conf]); 
      } 
    return;  
    }  
    catch (Exception ex)  
    {  
        return ("ERROR: " + ex.ToString());  
    }  
    finally 
    { 
        mut.ReleaseMutex(); 
        System.GC.Collect(); 
    } 

 

See Also