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
 Scroll to the selected image?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

860 Posts

Posted - Sep 23 2020 :  14:12:30  Show Profile  Reply
I select an image programmatically in a TImageEnMView (previously filled with AddShapesToImageEnMView) with:

ImageEnMView1.SelectImage(i);


How can I then scroll to the selected image?

I have searched in the documentation but have not found this functionality.

xequte

38182 Posts

Posted - Sep 23 2020 :  17:48:24  Show Profile  Reply
Hi Peter

Calling SelectImage only marks the image as selected, it is not the correct method to make it as current (and selected). For that, set SelectedImage (sorry, for historical reasons, that is a bit confusing).

When setting SelectedImage it will bring it into view if SelectedImageAlwaysVisible = True.

Note: You can call the following at any time to scroll the view to the current image:

ImageEnMView1.SelectedImageAlwaysVisible := True;

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

PeterPanino

860 Posts

Posted - Sep 23 2020 :  17:50:50  Show Profile  Reply
Hi Nigel,

thank you for the information.

Now, SelectedImage does scroll to the selected image. But it scrolls only to the first row with the selected image.

So I additionally call CenterSelected which centers the selected image in the client area.

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