Page 1 of 1

Using SetVScrollBarPosition to scroll to Annotation

Posted: Thu Nov 11, 2021 3:00 pm
by cbingram
I am using the GdViewer and would like to programatically scroll a document to an existing annotation. With the annotation I have the coordinates of the top-left point of that annotation. Is there any method to calculate what value I would need to put into SetVScrollBarPosition(int) to scroll that annotation into view (preferably to the center of the screen).

Thank you for any guidance.

Re: Using SetVScrollBarPosition to scroll to Annotation

Posted: Thu Nov 18, 2021 11:43 am
by Fabio
Hello,

From my understanding, what you can do to automatically display an existing annotation in the viewer, is to select the page and zoom in regarding the coordinates of the annotation.

Display a page: https://www.gdpicture.com/guides/gdpict ... yPage.html
Get the annotation coordinates: https://www.gdpicture.com/guides/gdpict ... Value.html
Zoom on the annotation: https://www.gdpicture.com/guides/gdpict ... mArea.html

Hope it helps,
Fabio

Re: Using SetVScrollBarPosition to scroll to Annotation

Posted: Mon Dec 13, 2021 7:56 pm
by lcariglia
Fabio,
the suggestion sounds good, but what if I'd like to keep the same zoom factor?

Re: Using SetVScrollBarPosition to scroll to Annotation

Posted: Tue Dec 14, 2021 1:17 pm
by Fabio
Hello,

Do you mean to keep the zoom at 135% (for instance) but show the annotation in the center of the viewer?

Regards,
Fabio