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