DeleteAnnotation Returns Invalid Parameter

Discussions about annotation support.
Post Reply
myow
Posts: 10
Joined: Wed Mar 21, 2012 4:34 pm

DeleteAnnotation Returns Invalid Parameter

Post by myow » Thu Mar 22, 2012 5:26 pm

I am using the latest trial version (8.5) of GdPicture .Net. When the following code is run on a document page with 5 annotations, it returns a invalid parameter(2) on the deleteannotation for the last two annotations and they are not deleted. If you run the same code again with the two annotations on the page it will delete the first one and return a invalid parameter(2) status on the second one and not delete it. Any help would be appreciated.

Code: Select all

        annotMgr = New AnnotationManager
        annotMgr.InitFromGdPictureImage(imageID)
        For i As Integer = 0 To annotMgr.GetAnnotationCount() - 1
            Dim x As GdPictureStatus = annotMgr.DeleteAnnotation(i)
        Next
        annotMgr.Close()
        Me.GdViewer1.DisplayFromGdPictureImage(imageID)
        Me.GdViewer1.ReloadAnnotations()
        Me.GdViewer1.Redraw()

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: DeleteAnnotation Returns Invalid Parameter

Post by Loïc » Fri Mar 23, 2012 3:43 pm

Hello,

Please replace:

Code: Select all

For i As Integer = 0 To annotMgr.GetAnnotationCount() - 1
       Dim x As GdPictureStatus = annotMgr.DeleteAnnotation(i)
Next
by:

Code: Select all

 For i As Integer = 0 To annotMgr.GetAnnotationCount() - 1
         Dim x As GdPictureStatus = annotMgr.DeleteAnnotation(0)
 Next

Kind regards,

Loïc

myow
Posts: 10
Joined: Wed Mar 21, 2012 4:34 pm

Re: DeleteAnnotation Returns Invalid Parameter

Post by myow » Mon Mar 26, 2012 1:33 pm

Thanks. I should have caught that. Sorry for wasting your time.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: DeleteAnnotation Returns Invalid Parameter

Post by Loïc » Mon Mar 26, 2012 4:39 pm

You're welcome! :D

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests