How to scroll the image to a make a region visible

Example requests & Code samples for GdPicture Toolkits.
Post Reply
reisrf
Posts: 27
Joined: Thu May 28, 2015 4:30 pm

How to scroll the image to a make a region visible

Post by reisrf » Thu May 28, 2015 4:43 pm

I am a beginner. I would like to know how can I scroll the image to make a specific region in the image visible?

I have tried:

annotMgr.SelectPage(pageToShow);
gdViewer1.LockViewer = true;
gdViewer1.ZoomArea(1, 1 , 2000 , 500);
gdViewer1.LockViewer = false;
gdViewer1.Redraw();

But the result is, the page moves to the "pageToShow", but the region presented is always he middle of the page. In the example above I would like to zoom to the top of the page

What I am doing wrong?

Thanks in advance,

Robson Reis

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

Re: How to scroll the image to a make a region visible

Post by Loïc » Thu May 28, 2015 6:36 pm

Hello,

There is a method for such purpose named EnsureRegionVisibility().
See: https://www.gdpicture.com/guides/gdpicture/web ... ility.html

Kind regards,

Loïc

reisrf
Posts: 27
Joined: Thu May 28, 2015 4:30 pm

Re: How to scroll the image to a make a region visible

Post by reisrf » Thu May 28, 2015 9:08 pm

Loic, thanks for the reply, but I have 2 problems:
1) When I do gdViewer. I can´t find in intelisens the EnsureRegionVisibility
2) If I solve issue 1, how can I get the RegionId? Do I need to create a Region and then call the EnsureRegionVisibility?

Thanks

Robson Reis

reisrf
Posts: 27
Joined: Thu May 28, 2015 4:30 pm

Re: How to scroll the image to a make a region visible

Post by reisrf » Fri May 29, 2015 1:10 pm

Complementing my previous post, in version 11.1.14 the method EnsureRegionVisibility is not available in gdViewer. I am stucked here.

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

Re: How to scroll the image to a make a region visible

Post by Loïc » Fri May 29, 2015 9:47 pm

Hello,

Actually I am not sure about what you are trying to do, but if the goal is to scroll the page to the stop-left of the page you can use the SetHVScrollBarPosition() method.
see: https://www.gdpicture.com/guides/gdpicture/web ... ition.html

So you would obtain something like:

Code: Select all

gdViewer1.LockViewer = true;
gdViewer1.ZoomArea(1, 1 , 2000 , 500);
gdViewer1.SetHVScrollBarPosition(0,0);
gdViewer1.LockViewer = false;
gdViewer1.Redraw();
Please let me know if you need further assistance on this.

With best regards,

Loïc

reisrf
Posts: 27
Joined: Thu May 28, 2015 4:30 pm

Re: How to scroll the image to a make a region visible

Post by reisrf » Fri May 29, 2015 10:20 pm

Loïc,
Many thanks. I have managed with your tips. You can close the case.

many thanks for your support.

Robson Reis

reisrf
Posts: 27
Joined: Thu May 28, 2015 4:30 pm

Re: How to scroll the image to a make a region visible

Post by reisrf » Fri May 29, 2015 10:59 pm

Loïc, just to confirm, the method EnsureRegionVisibility(). is not available in the version I am using, right?

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

Re: How to scroll the image to a make a region visible

Post by Loïc » Sat May 30, 2015 11:02 am

Hi Rob, no the EnsureRegionVisibility() should be available in your edition. It has been introduced in the 11.1.14 release.
See the change log here: viewtopic.php?t=4810

reisrf
Posts: 27
Joined: Thu May 28, 2015 4:30 pm

Re: How to scroll the image to a make a region visible

Post by reisrf » Sun May 31, 2015 2:50 am

I can´t find in the documentation:
GdPicture11 Namespace > GdViewer Class : EnsureRegionVisibility Method

But when I write
gdViewer1. , in the intelisense I can see

...
EnableTextSelection
EndInvoke NO EnsureRegionVisibility
Enter
Equals
...

reisrf
Posts: 27
Joined: Thu May 28, 2015 4:30 pm

Re: How to scroll the image to a make a region visible

Post by reisrf » Sun May 31, 2015 2:02 pm

Just correcting my previous reply, in the documentation I CAN FIND the method EnsureRegionVisibility. But in the class I can't.

reisrf
Posts: 27
Joined: Thu May 28, 2015 4:30 pm

Re: How to scroll the image to a make a region visible

Post by reisrf » Fri Jun 12, 2015 1:50 pm

I have found I had an old GDPicture dll in the path. Now I have the latest and I can find the EnsureRegionVisibility. THANKS!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests