Using SetVScrollBarPosition to scroll to Annotation

Example requests & Code samples for GdPicture Toolkits.
Post Reply
cbingram
Posts: 4
Joined: Fri Oct 22, 2021 4:00 pm

Using SetVScrollBarPosition to scroll to Annotation

Post by cbingram » Thu Nov 11, 2021 3:00 pm

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.

User avatar
Fabio
Posts: 173
Joined: Thu Aug 27, 2020 9:57 am

Re: Using SetVScrollBarPosition to scroll to Annotation

Post by Fabio » Thu Nov 18, 2021 11:43 am

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

lcariglia
Posts: 1
Joined: Mon Dec 13, 2021 7:47 pm

Re: Using SetVScrollBarPosition to scroll to Annotation

Post by lcariglia » Mon Dec 13, 2021 7:56 pm

Fabio,
the suggestion sounds good, but what if I'd like to keep the same zoom factor?

User avatar
Fabio
Posts: 173
Joined: Thu Aug 27, 2020 9:57 am

Re: Using SetVScrollBarPosition to scroll to Annotation

Post by Fabio » Tue Dec 14, 2021 1:17 pm

Hello,

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

Regards,
Fabio

Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 1 guest