VintaSoft Imaging .NET SDK v8.6
Vintasoft.Imaging.Annotation Namespace / AnnotationData Class / Clone Method
Example



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 Object
    public abstract object Clone()
    public: abstract Object* Clone(); 
    public:
    abstract Object^ Clone(); 

    Return Value

    A new object that is a copy of this instance.
    Example
    This example 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: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also