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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Selection, Zoom and ViewXY

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
BionicWave Posted - Feb 18 2012 : 16:19:33
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?
1   L A T E S T    R E P L I E S    (Newest First)
BionicWave Posted - Feb 18 2012 : 17:30:29
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.