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

Master.DrawRectangle 方法 (Visio)Master.DrawRectangle Method (Visio)

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

Shapes集合中的页面、 主控形状或组中添加一个矩形。Adds a rectangle to the Shapes collection of a page, master, or group.

语法Syntax

表达式DrawRectanglex1y1x2y2expression . DrawRectangle( x1 , y1 , x2 , y2 )

表达式_一个表示对象的变量。_expression A variable that represents a Master object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
x1x1必需RequiredDoubleDoubleX-矩形的宽度-高度框的一个角的坐标。The x-coordinate of one corner of the rectangle's width-height box.
y1y1必需RequiredDoubleDoubleY-矩形的宽度-高度框的一个角的坐标。The y-coordinate of one corner of the rectangle's width-height box.
x2x2必需RequiredDoubleDoubleX-矩形的宽度-高度框的另一个角的坐标。The x-coordinate of the other corner of the rectangle's width-height box.
y2y2必需RequiredDoubleDoubleY-矩形的宽度-高度框的另一个角的坐标。The y-coordinate of the other corner of the rectangle's width-height box.

返回值Return Value

ShapeShape

注解Remarks

使用DrawRectangle方法等效于在应用程序中使用矩形工具。参数采用矩形放置位置的页面、 主控形状或组的坐标空间的内部绘图单位表示。Using the DrawRectangle method is equivalent to using the Rectangle tool in the application. The arguments are in internal drawing units with respect to the coordinate space of the page, master, or group where the rectangle is being placed.

示例Example

以下示例显示如何在活动页上绘制一个矩形。The following example shows how to draw a rectangle on the active page.


Public Sub DrawRectangle_Example() 

 Dim vsoShape As Visio.Shape 

 Set vsoShape = ActivePage.DrawRectangle(1, 4, 4, 1) 

End Sub
© 2018 Microsoft