Table of Contents

TTMSFNCWXOCRCustomHelper Class

Base control that displays an image and lets the user draw rectangular regions over it to recognize the text they contain. It crops each selected region, submits it to an attached text recognition engine, and draws feedback over the image: an index label per selection and a confidence-colored box around each recognized word. Selection sets can be saved as reusable templates and reloaded, including from JSON.

API unit family: TMSFNCWXOCRHelper Inherits from: TTMSFNCCustomControl

Syntax

TTMSFNCWXOCRCustomHelper = class(TTMSFNCCustomControl)

Remarks

This is the implementation base; the published, design-time component is the descendant control that exposes these members as published properties.

Properties

Name Description
SelectionResults The selections currently held by the control, each with its cropped bitmap, position, processing state, and recognition result when available.

Methods

Name Description
CheckRectanglesAvailableForOCR Indicates whether at least one selection is awaiting recognition.
ClearAll Removes all selections and their results, then repaints the control.
ClearNonProcessedSelections Removes only the selections that have neither a result nor a pending recognition request, then repaints the control. Completed and in-progress selections are kept.
LoadTemplate Creates a selection for each region in the supplied template by cropping the corresponding part of the source image, then repaints the control. Use this to reapply a previously saved set of regions.
LoadTemplateFromJSON Deserializes a template from a JSON string and applies its regions to the current image.
ResetOCR Stops the attached recognition engine and clears all selections, then repaints the control.
SaveTemplateToJSON Builds a template from the current selections and serializes it to a JSON string.
SaveToTemplate Builds a template from the current selections so the set of regions can be reused or persisted.
StartFullImageOCR Submits the entire source image as a single selection for recognition.
StartOCR Submits every selection that has not yet been recognized and is not already in progress. When no such selection exists, the full image is submitted instead.