Expression > Home page del forum > Deep Zoom Composer > How to change intital view?
Formula una domandaFormula una domanda
 

DomandaHow to change intital view?

  • mercoledì 17 giugno 2009 6.25Radeldudel Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     

    How can I change the initial view of my image?

    The image is panoramic, and right now the initial view is stuck to the top of the viewport.

    I would like to move the initial view down, to center the image to the viewport, for more convenient zooming into the picture.

    thanks in advance,
    Sam

Tutte le risposte

  • mercoledì 17 giugno 2009 7.15Baruni Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Contiene codice
    You make changes in the page.xaml.cs file.

    ViewportWidth
    The width of the area of the image displayed. This value is in logical coordinates. For example, a value of 1 displays the entire image (no zoom), a value of 0.5 is 200% zoomed in, and a value of 0 is completely zoomed (user cannot see the image at all). A value above 1 is zooming out from the image. For example, a value of 2 means that the image will take up half the size of the MultiScaleSubImage control area (50% zoom).


    The ViewportOrigin
    X (-0.02456985) =  The left coordinate of the rectangular area of the image to be displayed. The coordinates of the point are in local coordinates (0-1) relative to the displayed image width.
    Y (-0.35426895) = The top coordinate of the rectangular area of the image to be displayed. The coordinates of the point are in local coordinates (0-1) relative to the displayed image width.


            void msi_ImageOpenSucceeded(object sender, RoutedEventArgs e)
            {
                this.msi.ViewportWidth = 0.5;
                this.msi.ViewportOrigin = new Point(-0.02456985, -0.035426895);
                ZoomFactor = 0.5;
            }
    
    See further:

    http://msdn.microsoft.com/en-us/library/cc645050(VS.95).aspx