GdPicture.NET.14
GdPicture14 Namespace / GdPictureOCR Class
Members Example





In This Topic
GdPictureOCR Class
In This Topic
The GdPictureOCR class offers the comprehensive optical character recognition (OCR) support. It is used as a wrapper class to allow you easily process the OCR on your documents and to find out required results in one place.
Syntax
'Declaration
 
Public NotInheritable Class GdPictureOCR 
public sealed class GdPictureOCR 
public class GdPictureOCR sealed; 
public sealed class GdPictureOCR 
public __gc __sealed class GdPictureOCR 
public ref class GdPictureOCR sealed 
Remarks
You need to create an object of this class to fully perform the OCR on your files. This object allows you to set all required OCR parameters and subsequently it enables you to very easily find out the OCR results.
Example
How to use the instance of the GdPictureOCR class to process the OCR on your documents.
Dim caption As String = "Example: GdPictureOCR class"
Using gdpictureOCR As GdPictureOCR = New GdPictureOCR()
 
    'Set up your prefered parameters for OCR.
    gdpictureOCR.ResourcesFolder = "\GdPicture.Net 14\redist\OCR"
    gdpictureOCR.AddLanguage(OCRLanguage.English)
 
    'Set up the image you want to process.
 
    'Run the OCR process.
    Dim resID As String = gdpictureOCR.RunOCR()
    If gdpictureOCR.GetStat() = GdPictureStatus.OK Then
        'Check the results.
        Dim wordCount As Integer = gdpictureOCR.GetWordCount(resID)
        'Continue ...
    Else
        MessageBox.Show("The OCR process has failed with the status: " + gdpictureOCR.GetStat().ToString(), caption)
    End If
 
    'Continue ...
End Using
string caption = "Example: GdPictureOCR class";
using (GdPictureOCR gdpictureOCR = new GdPictureOCR())
{
    //Set up your prefered parameters for OCR.
    gdpictureOCR.ResourcesFolder = "\\GdPicture.Net 14\\redist\\OCR";
    gdpictureOCR.AddLanguage(OCRLanguage.English);
 
    //Set up the image you want to process.
 
    //Run the OCR process.
    string resID = gdpictureOCR.RunOCR();
    if (gdpictureOCR.GetStat() == GdPictureStatus.OK)
    {
        //Check the results.
        int wordCount = gdpictureOCR.GetWordCount(resID);
        //Continue ...
    }
    else
    {
        MessageBox.Show("The OCR process has failed with the status: " + gdpictureOCR.GetStat().ToString(), caption);
    }
 
    //Continue ...
}
Inheritance Hierarchy

System.Object
   GdPicture14.GdPictureOCR

See Also