How to search text annotation in TIFF file?

Questions, comments and suggestions concerning VintaSoft Annotation .NET Plug-in.

Moderator: Alex

Post Reply
Alex
Site Admin
Posts: 1474
Joined: Thu Jul 10, 2008 2:21 pm

How to search text annotation in TIFF file?

Post by Alex » Wed Jul 23, 2008 3:20 pm

VintaSoftAnnotation.NET Plug-in can be used for annotation of images stored in TIFF file. Later image can be searched in TIFF file using it's annotation. Example below shows how to search image into TIFF file.

Here is a code sample for VB.NET:

Code: Select all

  Dim images As ImageCollection = new ImageCollection()
  Dim annotations As AnnotationController = new AnnotationController(images)
  images.Add("TiffWithAnnotations.tiff")
  Dim imageIndex As Integer, annoIndex As Integer
  For imageIndex = 0 To images.Count - 1
    Dim imageAnnotations As AnnotationCollection = annotations(imageIndex)
    For annoIndex = 0 To imageAnnotations.Count - 1
         Dim textAnno As TextAnnotation = CType(imageAnnotations(annoIndex), TextAnnotation)
         If textAnno.GetType() Is GetType(TextAnnotation) Then
         If textAnno.Text = "MySearchString"
           MsgBox "Annotation 'MySearchString' is found!"
         End If
       End If
    Next annoIndex
  Next imageIndex
and here is a code sample for C#:

Code: Select all

  ImageCollection images = new ImageCollection();
  AnnotationController annotations = new AnnotationController(images);
  images.Add("TiffWithAnnotations.tiff");
  for (int imageIndex = 0; imageIndex < images.Count; imageIndex++)
  {
    AnnotationCollection imageAnnotations = annotations[imageIndex];
    for (int annoIndex = 0; annoIndex < imageAnnotations.Count; annoIndex++)
    {
       TextAnnotation textAnno = imageAnnotations[annoIndex] As TextAnnotation;
       if (textAnno != null)
       {
         if (textAnno.Text == "MySearchString")
         {
           MessageBox.Show("Annotation 'MySearchString' is found!");
         }
       }
    }
  }

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest