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
 Selection, Zoom and ViewXY
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

BionicWave

Germany
33 Posts

Posted - Feb 18 2012 :  16:19:33  Show Profile  Reply
I looked at the online-help but could not find the right property for my problem.

When i zoom into a picture and move a selection, i want to adjust the ViewX and ViewY, so that the selection stays visible.

This is easy to do for SelX1 and ViewX, because i can calculate when selection is smaller then SelX1.

Now i would like to move the view to the right whenever the selection SelX2 is bigger than the visible window.

How can i calculate this?

BionicWave

Germany
33 Posts

Posted - Feb 18 2012 :  17:30:29  Show Profile  Reply
I think i found the solution.
I have to calculate the borders of the view by doing:

ViewLeft := trunc(imgen.viewX * (100 / img.zoom));
ViewRight := trunc( ImageEn.Clientwidth * (100 / img.zoom));

Then i can calculate if a given point is inside the viewable zoomed area.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: