VintaSoft Annotation .NET Plug-in Discussions

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

Board index < VintaSoft Imaging < VintaSoft Annotation .NET Plug-in Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

How to search text annotation in TIFF file?



How to search text annotation in TIFF file?

Post by Alex »

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:
  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#:
  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!");
         }
       }
    }
  }


Page 1 from 1: 1