DrawingML Pictures
A picture can be added to a word processing document, a spreadsheet, or a presentation. 图片可以添加到文字处理文档、电子表格或演示文稿中。Adding a picture to any of these document types requires two components--(1) information about the picture itself, and (2) information about its placement within the document. 向这些文档类型中的任何一种添加图片都需要两个组件—(1)有关图片本身的信息,以及(2)有关图片在文档中的位置的信息。The former is common to all document types, and much of the XML for this information is within the main drawingML namespace (xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"). 前者对于所有文档类型都是通用的,并且此信息的大部分XML都在主drawingML命名空间中(xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main")。The information regarding placement and positioning within a document, including the high-level elements and the non-visual properties, is specified in separate namespaces and varies based upon the document type . 有关文档中放置和定位的信息(包括高级元素和非可视属性)在单独的名称空间中指定,并根据文档类型而有所不同。See DrawingML Overview for more on the namespaces. 有关名称空间的更多信息,请参阅DrawingML概述。
A picture is specified with a <pic> element. 使用<pic>元素指定图片。The namespace in wordprocessing documents is in the picture namespace of drawingML xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture". wordprocessing文档中的名称空间位于drawingML xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"的图片名称空间中。This is what is used for most of the sample XML on these pages. 这就是这些页面上大多数示例XML所使用的内容。In spreadsheets, it is the spreadsheet drawingML namespace xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing". 在电子表格中,它是电子表格drawingML xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"命名空间。In presentations it is in the main presentation namespace xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main".在演示文稿中,它位于主演示文稿xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"命名空间中。
A picture can have such characteristics as border, resizing behavior, overlaid fills, and other effects. 图片可以具有边框、大小调整行为、重叠填充和其他效果等特征。A sample picture within a word processing document is shown below. 文字处理文档中的示例图片如下所示。
Elements:
A picture has three basic components--the fill or content that fills up the picture rectangle, non-visual properties, and shape properties. 图片有三个基本组成部分——填充图片矩形的填充或内容、非视觉属性和形状属性。Spreadsheets and presentations also have associated styles. 电子表格和演示文稿也有相关的样式。These components are specified with the elements below.这些组件由以下元素指定。
Element | |
---|---|
blipFill [BLIP = binary large image or picture] | Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 20.2.2.1.
|
nvPicPr | Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 20.2.2.4.
|
spPr | Reference:
|
style (only in spreadsheets and presentations) | Specifies the style that is applied to a picture or shape and the references for each of the style components, such as lines, fills, fonts, and effects. See Shapes - Styles for more.
Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 19.3.1.46 and § 20.5.2.31.
|
A <xrd:pic> element within a spreadsheet document can have the following attributes.
Attributes:
Attribute Value | Description |
---|---|
fPublished (spreadsheets only) | Indicates whether the picture should be published with the worksheet when sent to the server. |
macro (spreadsheets only) | Specifies a function associated with the object. E.g., macro="DoWork()". |