Expression > 포럼 홈 > Deep Zoom Composer > How to change intital view?
질문하기질문하기
 

질문How to change intital view?

  • 2009년 6월 17일 수요일 오전 6:25Radeldudel 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    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

모든 응답

  • 2009년 6월 17일 수요일 오전 7:15Baruni 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     코드 있음
    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