How Do I Set the Initial Viewport Zoom?
Can you tell me how to set the initial zoom of a multiscale image correctly? The zoom property of the mxml appears to set the component zoom, not the viewport zoom.
I know how to drive the viewport to a zoom procedurally after the image is constructed; however I'd like the first image the user sees to be at my prescribed zoom level. If I use zoomTo() after the app setup is complete I get the big blurry image for a few frames and then the new scale pops up.
I'm guessing there is an option somewhere that i'm missing.
thanks,
Pat
I know how to drive the viewport to a zoom procedurally after the image is constructed; however I'd like the first image the user sees to be at my prescribed zoom level. If I use zoomTo() after the app setup is complete I get the big blurry image for a few frames and then the new scale pops up.
I'm guessing there is an option somewhere that i'm missing.
thanks,
Pat
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
-
Inappropriate?Pat,
Unfortunately, the initial viewport properties in the component are somewhat broken. Have you tried setting the viewport right after Event.COMPLETE fired?
–Daniel -
Inappropriate?The answer is that I was loading the image descriptor XML file from the server and this is an asynchronous process... So the image component and viewport setup were on two different threads (I forget exactly what was happening - I had drawn a sequence diagram at one point but lost it. I think one track was started when the component's children were created and the other was explicitly an async url load). The result was that it was difficult to know when things were stable because sometimes you'd get a viewport setup event before and after the real image descriptor was set.
So I just changed to a static (hard coded) image descriptor in the MXML and it was fine... not as flexible, but fine. -
Inappropriate?Pat,
I understand. However, if you load your descriptor and know when it's done you can assign it to the MultiScaleImage and immediately afterwards set the viewport bounds.
–Daniel
The company says
this answers the question
Loading Profile...




EMPLOYEE