如何改变初始视图? [英] How to change intital view?

查看:61
本文介绍了如何改变初始视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改图像的初始视图?

图像是全景图像,现在初始视图粘贴在视口的顶部。

我想将初始视图向下移动,使图像居中到视口,以便更方便地放大图片。

提前感谢,山姆

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

推荐答案

您在page.xaml.cs文件中进行了更改。

ViewportWidth
图像区域的宽度显示。该值以逻辑坐标表示。例如,值1显示整个图像(无缩放),值0.5为200%放大,值0完全缩放(用户根本无法看到图像)。大于1的值将从图像缩小。例如,值为2意味着图像将占用 MultiScaleSubImage 控制区域(50%缩放)的一半大小。


ViewportOrigin
X(-0.02456985)=要显示的图像的矩形区域的左侧坐标。该点的坐标相对于显示的图像宽度在本地坐标(0-1)中。
Y(-0.35426895)=要显示的图像的矩形区域的顶部坐标。点的坐标相对于显示的图像宽度在本地坐标(0-1)中。


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;
        }


进一步了解:

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

See further:

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



这篇关于如何改变初始视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆