Annotation Bugs
Posted: Fri Apr 28, 2017 10:34 am
Hello,
I have noticed a few bugs with the annotations implementation.
I am drawing an a rect box on a gdpicture viewer, then using code to place an annotion (rectangle) in that place, as well as lots of other annotations which make it look like that box is a container for all the other annotations.
I am handling the gdviewer.annotationMoved event, so that when I move that container annotation, i get the new position and move all the other annotations to the same location, making it look like the container annotation actually contains them.
When I use the following code in AnnotationMoved:
_lControls(id).labelObject.Left = _gdViewer.GetAnnotationFromIdx(AnnotationIdx).Left
_lControls(id).labelObject.Top = _gdViewer.GetAnnotationFromIdx(AnnotationIdx).Top - 0.2
_gdViewer.GetAnnotationFromIdx(AnnotationIdx).Top returns the center point on the moved annotation, not the top point. For example, if I move a 1 inch in height annotation to the top left cornet for the document, left will return 0 (or close to it) but top will return 0.5, not 0.
Also, AnnotationMoved doesn't fire everytime. If i continually move the annotation around, in 1 in every 5 or so the annotation moved event doesn't get raised.
I'm using the latest version of gdpicture12
Cheers,
Matt
I have noticed a few bugs with the annotations implementation.
I am drawing an a rect box on a gdpicture viewer, then using code to place an annotion (rectangle) in that place, as well as lots of other annotations which make it look like that box is a container for all the other annotations.
I am handling the gdviewer.annotationMoved event, so that when I move that container annotation, i get the new position and move all the other annotations to the same location, making it look like the container annotation actually contains them.
When I use the following code in AnnotationMoved:
_lControls(id).labelObject.Left = _gdViewer.GetAnnotationFromIdx(AnnotationIdx).Left
_lControls(id).labelObject.Top = _gdViewer.GetAnnotationFromIdx(AnnotationIdx).Top - 0.2
_gdViewer.GetAnnotationFromIdx(AnnotationIdx).Top returns the center point on the moved annotation, not the top point. For example, if I move a 1 inch in height annotation to the top left cornet for the document, left will return 0 (or close to it) but top will return 0.5, not 0.
Also, AnnotationMoved doesn't fire everytime. If i continually move the annotation around, in 1 in every 5 or so the annotation moved event doesn't get raised.
I'm using the latest version of gdpicture12
Cheers,
Matt