Table of contents
TOC
折叠目录
展开目录

Viewer.GetPageView 方法 (Visio Viewer)Viewer.GetPageView Method (Visio Viewer)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

在 Microsoft Visio Viewer 中获取的位置和缩放因子 (大小) 的绘图页。Gets the position and zoom factor (size) of the drawing page in Microsoft Visio Viewer.

语法Syntax

表达式GetPageView( PageXAtViewCenterPageYAtViewCenterZoomFactor)expression. GetPageView( PageXAtViewCenter, PageYAtViewCenter, ZoomFactor)

_expression_An 表达式,该表达式返回一个查看器_expression_An expression that returns a Viewer object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
PageXAtViewCenterPageXAtViewCenter必需RequiredDoubleDouble从页面的左下角测量的页上,在绘图页的单位,中心的 x 坐标。The x-coordinate of the center of the page, in drawing-page units, measured from the lower left corner of the page.
PageYAtViewCenterPageYAtViewCenter必需RequiredDoubleDouble从页面的左下角测量的页上,在绘图页的单位,中心的 y 坐标。The y-coordinate of the center of the page, in drawing-page units, measured from the lower left corner of the page.
ZoomFactorZoomFactor必需RequiredDoubleDouble缩放 (纸张大小) 相乘的系数。The factor by which the zoom (page size) is multiplied.

返回值Return Value

Nothing

注解Remarks

网页视图包含的页,以在页; 左下角坐标系统的原点的 x-y 页坐标表示的中心点并表示为一个数字的百分比,范围从 1%到 400%的缩放系数。The page view consists of the center point of the page, expressed in x-y page coordinates, with the origin of the coordinate system at the lower left corner of the page; and the zoom factor, expressed as a numerical percentage, with range from 1% to 400%.

可以使用SetPageView方法来设置当前页面视图值。You can use the SetPageView method to set the current page-view values.

GetPageView方法本身返回执行任何操作,但其参数是所有的 out 参数。如果通过为每个参数的类型的变量,Visio Viewer 将返回值分别为每个参数,如本主题中的示例所示。The GetPageView method itself returns nothing, but its parameters are all out-parameters. If you pass a variable of type Double for each parameter, Visio Viewer returns the respective values of each parameter, as shown in the example in this topic.

GetPageView方法获取 Visio Viewer 窗口的中心位于页坐标系统中的点的坐标。例如,如果 Visio Viewer 返回的 x 坐标和 y 坐标为 0,左下的角 (该页面的坐标系统的原点) 是页面的在 Visio Viewer 窗口的中心。如果页面是 8 页单位宽 10 个页面单位高和页面的中心是在 Visio Viewer 窗口的中心,PageXAtViewCenter 返回 4 和 PageYAtViewCenter 将返回 5。The GetPageView method gets the coordinates of the point in the page coordinate system that is at the center of the Visio Viewer window. For example, if Visio Viewer returns 0 for both the x-coordinate and y-coordinate, the lower left corner of the page (the origin of the page's coordinate system) is in the center of the Visio Viewer window. If the page is 8 page-units wide by 10 page-units high, and the center of the page is at the center of the Visio Viewer window, PageXAtViewCenter returns 4 and PageYAtViewCenter returns 5.

ZoomFactor 参数值是两页的尺寸相乘的系数。例如,.5 ZoomFactor 值意味着该网页是为高的一半和一半土源 Visio 绘图中。The ZoomFactor parameter value is the factor by which both dimensions of the page are multiplied. For example, a ZoomFactor value of .5 means that the page is both half as high and half as wide as it is in the source Visio drawing.

示例Example

下面的代码演示如何获取当前的位置和缩放因子在 Visio Viewer 中打开的页面。The following code shows how to get the current position and zoom factor of the page that is open in Visio Viewer.

 Dim dblXPoint As Double

    Dim dblYPoint As Double

    Dim dblZoomFactor As Double

    vsoViewer.GetPageView dblXPoint, dblYPoint, dblZoomFactor

    Debug.Print "x-coordinate is:"; dblXPoint

    Debug.Print "y-coordinate is:"; dblYPoint

    Debug.Print "Zoom factor is:"; dblZoomFactor
© 2018 Microsoft