' Save reference to the original metadata.
Dim igMetadataTreeOriginal As ImGearMetadataTree = DirectCast(igPage.Metadata.Child, ImGearMetadataTree)
' Prepare a TIF metadata tree.
Dim igMetaDataTreeTIF As ImGearMetadataTree
If (igPage.Metadata.Child.Format = ImGearMetadataFormats.TIF) Then
igMetaDataTreeTIF = DirectCast(igPage.Metadata.Child.Clone(), ImGearMetadataTree)
Else
igMetaDataTreeTIF = New ImGearMetadataTree(ImGearMetadataFormats.TIF, DirectCast(ImGearTIFTagIDs.FORMAT, Int32))
End If
' Replace page metadata with igMetaDataTreeTIF.
igPage.Metadata.Child = igMetaDataTreeTIF
' Save the art data into the metadata of the image.
ImGearART.SavePage(igARTPage, igPage)
' Save an image containing embedded ART 2.0 annotations into a ImGearPage object
Using localFile As New FileStream("test_art_save.tif", FileMode.Create)
ImGearFileFormats.SavePage(igPage, localFile, 0, _
ImGearSavingModes.OVERWRITE, ImGearSavingFormats.TIF_UNCOMP, Nothing)
End Using
' Restore original meta data.
igPage.Metadata.Child = igMetadataTreeOriginal