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.

Change/Override Image Loading Path (XMP)



Change/Override Image Loading Path (XMP)

Post by Sami.Marzouki »

Hi,

Is it possible to override the loading image process and instead get the image from database? When loading annotations from XMP file?
example when adding referenced image, I would like to save only the filename and extension in the xmp file but loading the image from database.

Kind regards,

Sami Marzouki


Re: Change/Override Image Loading Path (XMP)

Post by Alex »

Hello Sami,

Yes, you can store image and annotations separately.

Annotation collection associated with the image can be loaded from file or stream using the AnnotationCollection.Load method:
AnnotationViewer.Annotations[0].Load(streamWithAnnotations);
Annotation collection associated with the image can be saved to file or stream using the AnnotationCollection.Save method:
AnnotationViewer.Annotations[0].Save(streamWithAnnotations);
Best regards, Alexander


Re: Change/Override Image Loading Path (XMP)

Post by Sami.Marzouki »

Hello Sami,

Yes, you can store image and annotations separately.

Annotation collection associated with the image can be loaded from file or stream using the AnnotationCollection.Load method:
AnnotationViewer.Annotations[0].Load(streamWithAnnotations);
Annotation collection associated with the image can be saved to file or stream using the AnnotationCollection.Save method:
AnnotationViewer.Annotations[0].Save(streamWithAnnotations);
Best regards, Alexander
Hi Alex,

thank you for your fast answer.
But I'm talking of image loading in ReferencedImageAnnotation class, in the property Filename I'm storing only the filename without the path.
And from that, I would like to be able to control/overload the loading, because the images are stored in a SQL database.

Kind regards,

Sami Marzouki


Re: Change/Override Image Loading Path (XMP)

Post by Sami.Marzouki »

Hi Alex,

I think i've found my answer, i'm going through the annotationcollection and for
ReferencedImageAnnotation.Image i'm using the method SetImage to get the image from the database.

Is that a good way of using the SDK?

Kind regards,

Sami


Re: Change/Override Image Loading Path (XMP)

Post by Alex »

I think i've found my answer, i'm going through the annotationcollection and for
ReferencedImageAnnotation.Image i'm using the method SetImage to get the image from the database.
Is that a good way of using the SDK?
It's a good way but not the best.

The best way is create annotation class derived from ReferencedImageAnnotation and override
the Annotation.ReadXmlContent or Annotation.Deserialize method.

Please read the "Programing - Annotate images - Create a custom annotation" topic in the documentation.

Best regards, Alexander


Re: Change/Override Image Loading Path (XMP)

Post by Sami.Marzouki »

I think i've found my answer, i'm going through the annotationcollection and for
ReferencedImageAnnotation.Image i'm using the method SetImage to get the image from the database.
Is that a good way of using the SDK?
It's a good way but not the best.

The best way is create annotation class derived from ReferencedImageAnnotation and override
the Annotation.ReadXmlContent or Annotation.Deserialize method.

Please read the "Programing - Annotate images - Create a custom annotation" topic in the documentation.

Best regards, Alexander
thank you,

I will read it and implement it that way then.

Kind regards,

Sami


Page 1 from 1: 1