与形状相关的对象

Shape-related objects

InlineShapes 对象

InlineShapes objects

class docx.shape.InlineShapes(body_elm: CT_Body, parent: StoryPart)[源代码]

Sequence of InlineShape instances, supporting len(), iteration, and indexed access.

InlineShape 对象

InlineShape objects

InlineShapewidthheight 属性提供了一个长度对象,它是 Length 的一个实例。这些实例的行为类似于 int,但还具有内置单位转换属性,例如

The width and height property of InlineShape provide a length object that is an instance of Length. These instances behave like an int, but also have built-in units conversion properties, e.g.

>>> inline_shape.height
914400
>>> inline_shape.height.inches
1.0
class docx.shape.InlineShape(inline: CT_Inline)[源代码]

Proxy for an <wp:inline> element, representing the container for an inline graphical object.

property height: Length

Read/write.

The display height of this inline shape as an Emu instance.

property type

The type of this inline shape as a member of docx.enum.shape.WD_INLINE_SHAPE, e.g. LINKED_PICTURE.

Read-only.

property width

Read/write.

The display width of this inline shape as an Emu instance.