Change/Override Image Loading Path (XMP)

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

Moderator: Alex

Post Reply
Sami.Marzouki
Posts: 4
Joined: Mon Jan 23, 2012 1:19 pm

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
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

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:

Code: Select all

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

Code: Select all

AnnotationViewer.Annotations[0].Save(streamWithAnnotations);
Best regards, Alexander
Sami.Marzouki
Posts: 4
Joined: Mon Jan 23, 2012 1:19 pm

Re: Change/Override Image Loading Path (XMP)

Post by Sami.Marzouki »

Alex wrote: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:

Code: Select all

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

Code: Select all

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
Sami.Marzouki
Posts: 4
Joined: Mon Jan 23, 2012 1:19 pm

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
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

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
Sami.Marzouki
Posts: 4
Joined: Mon Jan 23, 2012 1:19 pm

Re: Change/Override Image Loading Path (XMP)

Post by Sami.Marzouki »

Alex wrote:
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
Post Reply