Settings ViewboxLimits
#1
Hi,

I am trying to do the following:-

Code:
zp.FitToHeight();
zp.ViewboxLimits = zp.Viewbox;

so that you cannot zoom out further than the fitted zoom

but this doesn't work presumably because the FitToHeight is working in another thread so the ViewboxLimits are set too soon before the Fit is completed.

how can I synchronise this correctly.

Ive been trying to calculate the ViewboxLimits manually but finding it a difficult with the various aspect ratios of the image and zoompanel ....

Jez
#2
By default, the FitToHeight method will start an animation that will slowly change the Viewbox to the viewbox that will show the content in the available height.

This is also written in the help file and online help for the FitToHeight method - [url=see https://www.ab4d.com/help/ZoomPanel/html...ht.htm]see https://www.ab4d.com/help/ZoomPanel/html...Height.htm[/url]

So, you just need to set IsAnimated to false before calling FitToHeight. Then the Viewbox will have the final value immediately after calling FitToHeigth.
Andrej Benedik
  


Forum Jump:


Users browsing this thread:
1 Guest(s)