OfficeOpenXML.com
 

DrawingML Pictures

Overview

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. 文字处理文档中的示例图片如下所示。

<pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">
<pic:nvPicPr>
<pic:cNvPr id="0" name="Blue hills.jpg"/>
<pic:cNvPicPr/>
</pic:nvPicPr>
<pic:blipFill>
<a:blip r:embed="rId4" cstate="print"/>
<a:stretch>
<a:fillRect/>
</a:stretch/>
</pic:blipFill>
<pic:spPr>
<a:xfrm>
<a:off x="0" y="0"/>
<a:ext cx="2438400" cy="1828800"/>
</a:xfrm>
<a:prstGeom rst="rect>
<a:avLst/>
</a:prstGeom>
</pic:spPr>
</pic:pic>
Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 20.2.2.5 (word processing), § 20.5.2.25 (spreadsheets), and § 19.3.1.37 (presentations).

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.这些组件由以下元素指定。

ElementDescription描述
blipFill [BLIP = binary large image or picture] Specifies the type of picture fill that the picture has. 指定图片具有的图片填充类型。A picture has a fill already, but if the picture has transparent pixels, it is possible to add another fill within the <spPr> element by specifying, for example, a gradient fill. See Image Data, Tile or Stretch Image to Fill, and Effects for details of blipFill.

Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 20.2.2.1.
nvPicPr Specifies non-visual properties of a picture, such as locking properties, name, id and title, and whether the picture is hidden. 指定图片的非可视属性,例如锁定属性、名称、id和标题,以及图片是否隐藏。See Non-Visual Properties for details.有关详细信息,请参阅非可视属性

Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 20.2.2.4.
spPr Specifies the visual shape properties that can be applied to a picture. 指定可应用于图片的视觉形状属性。They are the same properties that can be applied to shapes. 它们与可应用于形状的属性相同。See Shapes - Visual Properties for more.

Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 20.2.2.6.ECMA-376,第3版(2011年6月),《基础知识和标记语言参考》第20.2.2.6节。
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 ValueDescription
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()".


Related HTML/CSS Property:

There is no corresponding HTML property.