Annotation outline disappearing
Posted: Wed Feb 05, 2020 4:36 pm
I'm saving the current annotation data to an object, and restoring it at a later date. But sometimes the outline is disappearing, it is part of the object when I save it but, but when I restore it, it's sometimes null. Any idea why this might be happening?
Thanks for any help,
Saving
Restoring
Thanks for any help,
Saving
Code: Select all
public void AnnotationsChanged(AnnotationDataController annotationDataController)
{
this._annotationDatas = new List<AnnotationDataCollection>();
for (int i = 0; i < annotationDataController.Images.Count; i++)
{
AnnotationDataCollection annotatonDataCollection = annotationDataController.GetAnnotations(i);
this._annotationDatas.Add((AnnotationDataCollection)annotatonDataCollection.Clone());
}
}
Code: Select all
private void LoadAnnotationsFromDisk()
{
try
{
if (DataManager.Instance.AnnotationDatas != null && DataManager.Instance.AnnotationDatas.Count > this.annotationViewer.FocusedIndex)
{
if (DataManager.Instance.AnnotationDatas[this.annotationViewer.FocusedIndex].Count > 0)
{
foreach(AnnotationData annotationData in DataManager.Instance.AnnotationDatas[this.annotationViewer.FocusedIndex])
{
try
{
if (!this.annotationViewer.AnnotationDataCollection.Contains(annotationData))
this.annotationViewer.AnnotationDataCollection.Add(annotationData);
}
catch(Exception ex)
{ }
}
}
}
}
catch (Exception ex)
{ }
}