Page 1 of 1

Editing the Image of a ReferencedImageAnnotation

Posted: Thu Jun 11, 2009 12:55 am
by ltiong
I'd like to:
1) create a ReferencedImageAnnotation
2) modify the Referenced image
3) and Save over the original linked file.

This worked for me previously in version 2.2 (build 2217), but it stopped working when i moved to version 2.2 (build 2223). It appears that the ReferencedImageAnnotation now locks the files that it links, preventing me from changing the original file with code or w/ an external application.

Was this intentional, or is there another way to accomplish this?



Code sample:

Code: Select all

// Given a ReferencedImageAnnotation
ReferencedImageAnnotation ria = new ReferencedImageAnnotation();
ria.Filename = "C:/mypicture.jpg";
...

// Edit the Image - create a Form to edit the Image. 
PictureEditDialog editDialog = new Anno_PictureEdit(ria.Image);

if (editDialog.ShowDialog(this) == DialogResult.OK){
     //save the Image back to disk
     Image modifiedImage = editDialog.Image;
     modifiedImage.Save(ria.Filename);

     ria.Filename = fileName;   //this refreshes the Annotation on the AnnotationViewer.
}

Thanks,
Lu

Re: Editing the Image of a ReferencedImageAnnotation

Posted: Thu Jun 11, 2009 3:58 pm
by Alex
Thank you for the information. We will fix this problem in version 3.0.

Best regards, Alexander

Re: Editing the Image of a ReferencedImageAnnotation

Posted: Fri Jun 12, 2009 8:04 pm
by ltiong
Awesome, thanks Alex.