This method converts the image containing text characters into text data.

[Visual Basic]
Public Sub ImageToText()
[C#]
public void ImageToText();

Return Value

None

Explanation

The ImageToText method converts the image containing text characters into text data. The resulting text data is set into the OutText property.

NOTE: The text data will be set into the OutText property after the GetOCRText event has completed. For this reason, there may be a slight delay while the OCR process is occurring within the GetOCRText event before the text data is set into the OutText property. If you wish to obtain the text data immediately after the ImageToText method is executed, retrieve it within the GetOCRText event.

If the method fails, the OutText property is set to "".

If executing the OCR functions in a language that is not supported by your environment, you will need to install the language package and then add that language to Windows under "Settings - Time and Language - Language and Region".

The minimum size of an image that can be read is 40 x 40 pixels and the maximum is 2600 x 2600 pixels, respectively.

 

Example

[C#]
public MainWindow()
{
     InitializeComponent();

     objOCR = new OCR();
     objOCR.GetOcrText += OCR_Event;
}

public void OCR_Event(object sender, OCREventArgs e)
{
     textBlock.Text = e.OcrText;
}

private void button1_Click(object sender, RoutedEventArgs e)
{
     objOCR.Language = "ja";
     objOCR.ImageToText(imagekit.Image);
}

See Also

OCR Class | OCR Members

The ImageKit.NET3 is created by Newtone Corporation