Expression > Форумы > Deep Zoom Composer > How to change intital view?
Задайте вопросЗадайте вопрос
 

ВопросHow to change intital view?

Все ответы

  • 17 июня 2009 г. 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