内联形状 ============ Inline shape .. tab:: 中文 Word 允许将图形对象作为内联对象放入文档中。内联形状作为 ```` 元素出现,是 ```` 元素的子元素。 .. tab:: 英文 Word allows a graphical object to be placed into a document as an inline object. An inline shape appears as a ```` element as a child of a ```` element. 候选协议——内联形状访问 ----------------------------------------- Candidate protocol -- inline shape access .. tab:: 中文 以下交互式会话说明了访问内联形状的协议: .. tab:: 英文 The following interactive session illustrates the protocol for accessing an inline shape:: >>> inline_shapes = document.body.inline_shapes >>> inline_shape = inline_shapes[0] >>> assert inline_shape.type == MSO_SHAPE_TYPE.PICTURE 资源 --------- Resources .. tab:: 中文 .. tab:: 英文 * `Document Members (Word) on MSDN`_ * `InlineShape Members (Word) on MSDN`_ * `Shape Members (Word) on MSDN`_ .. _Document Members (Word) on MSDN: http://msdn.microsoft.com/en-us/library/office/ff840898.aspx .. _InlineShape Members (Word) on MSDN: http://msdn.microsoft.com/en-us/library/office/ff840794.aspx .. _Shape Members (Word) on MSDN: http://msdn.microsoft.com/en-us/library/office/ff195191.aspx MS API ------ MS API .. tab:: 中文 Document 上的 Shapes 和 InlineShapes 属性保存对 MS API 中图片等内容的引用。 * 高度和宽度 * 边框 * 阴影 * 超链接 * PictureFormat(提供亮度、颜色、裁剪、透明度、对比度) * ScaleHeight 和 ScaleWidth * HasChart * HasSmartArt * 类型(图表、LockedCanvas、图片、SmartArt 等) .. tab:: 英文 The Shapes and InlineShapes properties on Document hold references to things like pictures in the MS API. * Height and Width * Borders * Shadow * Hyperlink * PictureFormat (providing brightness, color, crop, transparency, contrast) * ScaleHeight and ScaleWidth * HasChart * HasSmartArt * Type (Chart, LockedCanvas, Picture, SmartArt, etc.) 规范参考 --------------- Spec references * 17.3.3.9 drawing (DrawingML Object) * 20.4.2.8 inline (Inline DrawingML Object) * 20.4.2.7 extent (Drawing Object Size) 最小 XML ----------- Minimal XML .. highlight:: xml .. tab:: 中文 此 XML 代表了我对 Word 将加载的最小内联形状容器的最佳猜测:: .. tab:: 英文 This XML represents my best guess of the minimal inline shape container that Word will load :: 样本 XML ------------ Specimen XML .. tab:: 中文 ``CT_Drawing`` (````) 元素可以出现在运行中,例如作为 ```` 元素的对等元素。此元素包含 DrawingML 对象。WordprocessingML 绘图在 ISO/IEC 规范的第 20.4 节中进行了讨论。 此 XML 表示内联形状,该形状单独插入段落中。图形对象本身的细节已删除:: .. tab:: 英文 .. highlight:: xml A ``CT_Drawing`` (````) element can appear in a run, as a peer of, for example, a ```` element. This element contains a DrawingML object. WordprocessingML drawings are discussed in section 20.4 of the ISO/IEC spec. This XML represents an inline shape inserted inline on a paragraph by itself. The particulars of the graphical object itself are redacted:: 架构定义 ------------------ Schema definitions .. highlight:: xml ::