ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to synchronize scrollbars in TImageEnView
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AndyColmes

USA
351 Posts

Posted - Mar 13 2017 :  05:37:48  Show Profile  Reply
I am trying to synchronize 2 TImageEnView in zooming and scrolling. One of the issues that I am having is that sometimes the scrollbar position is not synchronized even after calling Invalidate for both TImageEnView, especially when one TImageEnView has a different scrollbar position. Is there a good way to make sure that the scrollbar position is synchronized in code without having to actually scroll with the scrollbar using the mouse to synchronize?

Thanks in advance.

Andy

w2m

USA
1990 Posts

Posted - Mar 13 2017 :  09:52:07  Show Profile  Reply
procedure TForm1.FormCreate(Sender: TObject);
begin
  ImageEnView1.Gestures.Pan.Enabled := True;
  ImageEnView1.Gestures.Zoom.Enabled := True;
  ImageEnView2.Gestures.Pan.Enabled := True;
  ImageEnView2.Gestures.Zoom.Enabled := True;
  ImageEnView1.IO.LoadFromFile('G:\Images\Microsoft\Monarch.jpg');
  ImageEnView2.IO.LoadFromFile('G:\Images\Microsoft\Monarch.jpg');
end;

procedure TForm1.ImageEnView1ViewChange(Sender: TObject; Change: Integer);
begin
  ImageEnView2.ViewX := ImageEnView1.ViewX;
  ImageEnView2.ViewY := ImageEnView1.ViewY;
end;

procedure TForm1.ImageEnView2ViewChange(Sender: TObject; Change: Integer);
begin
  ImageEnView1.ViewX := ImageEnView2.ViewX;
  ImageEnView1.ViewY := ImageEnView2.ViewY;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

AndyColmes

USA
351 Posts

Posted - Mar 16 2017 :  15:10:33  Show Profile  Reply
Thanks very much Bill. I will give that a try.

Andy
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: