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
 ViewChanging event

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
Ronald Ruijs Posted - Apr 16 2020 : 11:54:14
Hello,

I try to prevent "endless zoomout", resulting in very small image display, by limiting zoomfactor by overriding protected virtual ViewChanging(c: integer; newValue: Double) event.

From the doc, I see that c = 1 for Zoom change. but what is NewValue, and how do I stop zooming out infinitely? I expected that NewValue would be new desired zoomfactor. However, I get negative values for NewValue. Also, how should I prevent further processing? Should that be done by not calling inherited?

Best regards, Ronald
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Apr 21 2020 : 18:03:07
Hi Ronald

I've changed the source so that NewValue is now a var parameter. This should work for you if you override the ViewChanging method. Please email me for the update.

Note: Change = 2 is for zoom changes.

Nigel
Xequte Software
www.imageen.com
Ronald Ruijs Posted - Apr 21 2020 : 16:51:06
Hi Nigel,

Thanks for the explanation, although using a TImageEnView descendant, I would prefer to "build-in" this behaviour by overriding protected methods, rather than using public properties.
What is the VieChanging intended use? I could not find a demo that uses it.

Regards, Ronald

xequte Posted - Apr 20 2020 : 17:41:36
Hi Ronald

You should just use the OnZoomIn/Out events, e.g.

// Max zoom-out to 200%
Procedure Tform1.ImageEnView1ZoomOut(Sender: TObject; var NewZoom: Double);
Begin
  if NewZoom > 200 then
    NewZoom := 200;
End;


Nigel
Xequte Software
www.imageen.com