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
Change/Override Image Loading Path (XMP)
Moderator: Alex
-
- Posts: 4
- Joined: Mon Jan 23, 2012 1:19 pm
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: Change/Override Image Loading Path (XMP)
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:
Annotation collection associated with the image can be saved to file or stream using the AnnotationCollection.Save method:
Best regards, Alexander
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);
Code: Select all
AnnotationViewer.Annotations[0].Save(streamWithAnnotations);
-
- Posts: 4
- Joined: Mon Jan 23, 2012 1:19 pm
Re: Change/Override Image Loading Path (XMP)
Hi Alex,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:Annotation collection associated with the image can be saved to file or stream using the AnnotationCollection.Save method:Code: Select all
AnnotationViewer.Annotations[0].Load(streamWithAnnotations);
Best regards, AlexanderCode: Select all
AnnotationViewer.Annotations[0].Save(streamWithAnnotations);
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
-
- Posts: 4
- Joined: Mon Jan 23, 2012 1:19 pm
Re: Change/Override Image Loading Path (XMP)
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
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
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: Change/Override Image Loading Path (XMP)
It's a good way but not the best.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?
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
-
- Posts: 4
- Joined: Mon Jan 23, 2012 1:19 pm
Re: Change/Override Image Loading Path (XMP)
thank you,Alex wrote:It's a good way but not the best.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?
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
I will read it and implement it that way then.
Kind regards,
Sami