This example uses the GetSelectedAnnotationOcrType method to determine whether a selected OCR Zone annotation is a Picture zone or a Text zone. It then updates the appropriate option button on the form to indicate the OCR type.
This example also allows the user to change the OCR type of a selected OCR Zone annotation using the option buttons on the form. It uses the SetSelectedAnnotationOcrType method to set the OCR type.
Private Sub Form_Load()
'This example would determine whether a selected OCR recognition
'zone is defined as a Picture Zone or a Text Zone and would
'show a dialog box to allow the user to change the OCR zone type.
'Form used would have 2 option buttons labeled Picture Zone and
'Text Zone
Dim OCRType As AnnotationOcrTypeConstants
'Determine if the selected OCR annotation mark is a Text
'Zone or a Picture Zone and set the corresponding option
'button on the form.
OCRType = frmMain.ImgEdit1.GetSelectedAnnotationOcrType
If OCRType = wiOcrTypeText Then
optTextZone.Value = True
Else
optPictureZone.Value = True
End If
frmOCRType.Show
End Sub
Private Sub optPictureZone_Click()
'If the user clicks on the Picture Zone option button, the OCR
'Zone type is changed to a Picture Zone.
frmMain.ImgEdit1.SetSelectedAnnotationOcrType wiOcrTypePicture
End Sub
Private Sub optTextZone_Click()
'If the user clicks on the Text Zone option button, the OCR
'Zone type is changed to a Text Zone.
frmMain.ImgEdit1.SetSelectedAnnotationOcrType wiOcrTypeText
End Sub