I'm load a XMP file with some annotation. Make some modification in the annotation. Try to save to the same XMP file and alway get error. Looks like the file after open is not closed that is the reason I'm not able to rewrite de file.
Is there a way to do this or I'm doing something wrong.
This is the code used to Open and to Read.
Code: Select all
Private Sub SaveInXMPFormatToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveInXMPFormatToolStripMenuItem.Click
Dim SaveFileDialog1 As New SaveFileDialog
SaveFileDialog1.Title = "Save Annotations As XMP"
SaveFileDialog1.CheckFileExists = False
SaveFileDialog1.OverwritePrompt = False
SaveFileDialog1.Filter = "XMP|*.xmp"
If SaveFileDialog1.ShowDialog(Me) = DialogResult.OK Then
Dim FilePath As String = SaveFileDialog1.FileName
If GdViewer1.SaveAnnotationsToXMP(FilePath) = GdPictureStatus.OK Then
MsgBox("Annotations succefully saved as XMP in " & FilePath)
Else
MsgBox("Can't save annotations in " & FilePath)
End If
End If
End Sub
Code: Select all
Private Sub LoadFromXMLFileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadFromXMLFileToolStripMenuItem.Click
Dim OpenFileDialog1 As New OpenFileDialog
OpenFileDialog1.Title = "Open Annotations As XMP"
OpenFileDialog1.CheckFileExists = False
OpenFileDialog1.Filter = "XMP|*.xmp"
If OpenFileDialog1.ShowDialog(Me) = DialogResult.OK Then
Dim FilePath As String = OpenFileDialog1.FileName
If GdViewer1.LoadAnnotationsFromXMP(FilePath) <> GdPictureStatus.OK Then
MsgBox("Can't load annotations from " & FilePath)
End If
OpenFileDialog1.Dispose()
End If
End Sub