IRecognizedTextPartInfo Interface
This interface presents information about each part of the recognized text.

Part of text seems one part, that has all the same characteristics (style, color, etc.). It is divided by the words into parts, if have large text that has the same style.

Namespace: Aspose.OCR
Assembly: Aspose.OCR (in Aspose.OCR.dll) Version: 17.11
public interface IRecognizedTextPartInfo : IRecognizedPartInfo

The IRecognizedTextPartInfo type exposes the following members.

Public propertyBackgroundColor
Gets the color of background this part.
Public propertyBox
Gets the rectangular area where the detected block (with text or picture) is shown on the image. Coordinates starts with the upper left corner of the image.
(Inherited from IRecognizedPartInfo.)
Public propertyCharactersBox
Gets an array of rectangles. Size of the array is equal to size of Text (how many letters in part). Each rectangle indicates the area of character. Coordinates starts with the upper left corner of the picture.
Public propertyCharactersQuality
Gets an array of values specified for some recognition of this character. Size of the array is equal to size of Text (how many letters in part). Each array element can be from 0.0 to 1.0 inclusive. Value 0.0 means that the poorly recognized, 1.0 means that perfectly recognized.
Public propertyCode exampleChildren
Array of lower level text part (e.g. words for text line, or characters for word)
IRecognizedTextPartInfo firstBlock = (ocr.Text.PartsInfo[0] as IRecognizedTextPartInfo);
IRecognizedPartInfo[] linesOfFirstBlock = firstBlock.Children;
Public propertyIsTrimmed
Indicates whether recognition result was trimmed due to evaluation restrictions
Public propertyItalic
Gets a value that indicates whether this part is italic.
Public propertyLanguage
Gets the language of this part.
Public propertyCode exampleLevel
Shows hierarchical level of text part
IRecognizedTextPartInfo firstLine = (ocr.Text.PartsInfo[0] as IRecognizedTextPartInfo).Children[0];
Console.WriteLine(firstLine.Level); // will be TextPartLevel.Line
Public propertyText
Gets the text of this part.
Public propertyTextColor
Gets a color of text this part.
OcrEngine ocr = new OcrEngine();
ocr.Image = ImageStream.FromFile(@"image.tiff");
foreach (IRecognizedPartInfo recognizedPartInfo in ocr.Text.PartsInfo)
   if (recognizedPartInfo is IRecognizedTextPartInfo)
       IRecognizedTextPartInfo recognizedBlockInfo = recognizedPartInfo as IRecognizedTextPartInfo;
       string text = recognizedBlockInfo.Text;
       if (recognizedBlockInfo.Bold)
          text = String.Format("{0}", text);
       if (recognizedBlockInfo.Italic)
          text = String.Format("{0}", text);
See Also