Difference between revisions of "G11ntest/Documentation/BASIC Guide/Editing Drawing Objects"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Created page with '{{Documentation/BASICGuideTOC/v2 |ShowPrevNext=block |ShowPrevPage=block |PrevPage=Documentation/BASIC Guide/Structure of Drawings |NextPage=Documentation/BASIC Guide/Presentatio…')
 
 
Line 1: Line 1:
{{Documentation/BASICGuideTOC/v2
+
{{g11ntest/Documentation/BASICGuideTOC/v2
 
|ShowPrevNext=block
 
|ShowPrevNext=block
 
|ShowPrevPage=block
 
|ShowPrevPage=block

Latest revision as of 15:17, 2 September 2009

doc OOo
Book.png


分组对象

在很多情况下,有助于将多个图形对象一起,使它们充当一个大的对象。


以下示例将两个绘图对象:


Dim Doc As Object 
Dim页面中对象 
Dim正方形As Object 
DimAs Object 
Dim形状对象 
Dim组对象 
Dim点Point新 
Dim大小为新.awt.Size 
Dim用作新Point 
Dim高度长整数 
Dim宽度为长整数 
 
Doc=StarDesktop.CurrentComponent=Doc.drawPages(0) 
=3000 
=3000 
=3000 
=3000 
'建立正方形绘图元素 
正方形=Doc.createInstance("") 
=大小 
= 
=rgb() 
Page.add() 
 
 
'建立圆形绘图元素 =Doc.createInstance("") 
=大小 
= 
=rgb() 
=rgb(255,0) 
Page.add(信任环) 
 
 
'将正方形和圆形绘图元素 
形状=createUnoService("") 
() 
 
 
(信任环) 
group=(图形) 
中心组合的绘图元素 
height=
宽度=
=/2 
=高度/2 
height=
宽度=
=-宽度/2 
=高/2 
=


此代码建立了一个矩形和一个圆,然后将它们插入到页面中。 然后,它将创建一个对象,它支持/服务,并使用 Add 方法将矩形和圆加入到此对象。 将 ShapeCollection 加入到页面使用 方法并返回实际 对象中可编辑像编辑单个 形状


如果要格式化的单个对象的组,采用格式,然后将其添加到组中。 您不能修改后对象中。


运算符==旋转和修剪绘图对象==


所有绘图对象都在上面各节还可旋转和修剪使用/服务。


此服务提供了以下属性:


RotateAngle(长整数)
旋转角度,以百分之一度为单位
ShearAngle(长整数)
修剪角度以百分之一度为单位


以下示例会建立一个矩形,将其旋转30度使用 RotateAngle 属性:


lang=""> 

Dim Doc As Object Dim页面中对象 Dim RectangleShape As Object Dim点Point新 Dim大小为新.awt.Size


=1000 =1000 =10000 =10000


Doc=StarDesktop.CurrentComponent 页=Doc.drawPages(0)


RectangleShape=Doc.createInstance("") =大小 =


=3000


Page.add(RectangleShape) </source>


以下示例将创建一样的矩形上一个示例,而这个将其修剪30度使用 ShearAngle 属性。


lang=""> 

Dim Doc As Object Dim页面中对象 Dim RectangleShape As Object Dim点Point新 Dim大小为新.awt.Size


=1000 =1000 =10000 =10000


Doc=StarDesktop.CurrentComponent 页=Doc.drawPages(0) RectangleShape=Doc.createInstance("") =大小 =


=3000


Page.add(RectangleShape) </source>


搜索运算符==并替换==


与文本文档、绘图文档提供了一个函数用于搜寻和替换。 此功能与使用的文本文档中所述 [[文档/Basic_Guide</text_文档|Text Documents]]。 但是,在绘图文档的描述符对象用于搜寻和替换未直接建立通过文档对象,而是通过相关的字符级。 以下示例演示了中的替换过程绘图:


lang=""> 

Dim Doc As Object Dim页面中对象 Dim ReplaceDescriptor对象 Dim I as Integer


Doc=StarDesktop.CurrentComponent 页=Doc.drawPages(0)


使用ReplaceDescriptor=() ="" ="是"


For I=0To-1 页=Doc.drawPages(i) Page.ReplaceAll(ReplaceDescriptor) Next I </source>


此代码使用第一个 绘图 文档建立一个 ReplaceDescriptor ,然后将此描述符以循环的所有页面中绘图文档。


Content on this page is licensed under the Public Documentation License (PDL).
Personal tools