OcrFromClipBoard Example VB

This example demonstrates how to perform OCR on clipboard data pasted from the currently displayed image.

Private Sub cmdOcrClipBoard_Click()
    'Copy an area from the current image to the clipboard
    ImgEdit1.SelectionRectangle = True
    ImgEdit1.DrawSelectionRect 0, 0, 200, 200
    ImgEdit1.ClipboardCopy    
    'OCR the clipboard contents to a Text Document and launch
    'its associated application for viewing.
    Imgocr1.OcrFromClipBoard = True
    Imgocr1.OutputType = wiAsciiText
    Imgocr1.OutputFile = "c:\My Documents\sample.txt"
    Imgocr1.LaunchApplication = True    
    Imgocr1.StartOcr
End Sub