VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Imaging.Annotation Namespace / AnnotationData Class / Clone() Method
Syntax Example Requirements SeeAlso
In This Topic
    Clone() Method (AnnotationData)
    In This Topic
    Creates a new object that is a copy of the current instance.
    Syntax
    'Declaration
    
    Public MustOverride Function Clone() As System.Object
    
    
    public abstract System.Object Clone()
    
    
    public: abstract System.Object Clone()
    
    
    public:
    abstract System.Object Clone()

    Return Value

    A new object that is a copy of this instance.
    Example

    Here is an example that shows how to clone one annotation from a collection and add cloned annotation into the same collection:

    
    Private Sub CloneAndAdd(annotationCollection As Vintasoft.Imaging.Annotation.AnnotationDataCollection, index As Integer)
        ' clone annotation at specified index
        Dim clonedAnnotation As Vintasoft.Imaging.Annotation.AnnotationData = DirectCast(annotationCollection(index).Clone(), Vintasoft.Imaging.Annotation.AnnotationData)
        ' add cloned annotation to the end of the collection
        annotationCollection.Add(clonedAnnotation)
    End Sub
    
    
    
    void CloneAndAdd(Vintasoft.Imaging.Annotation.AnnotationDataCollection annotationCollection, int index)
    {
        // clone annotation at specified index
        Vintasoft.Imaging.Annotation.AnnotationData clonedAnnotation = 
            (Vintasoft.Imaging.Annotation.AnnotationData)annotationCollection[index].Clone();
        // add cloned annotation to the end of the collection
        annotationCollection.Add(clonedAnnotation);
    }
    
    

    Requirements

    Target Platforms: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also