MCPcopy Index your code
hub / github.com/python-openxml/python-docx / new_pic_inline

Method new_pic_inline

src/docx/oxml/shape.py:93–103  ·  view source on GitHub ↗

Create `wp:inline` element containing a `pic:pic` element. The contents of the `pic:pic` element is taken from the argument values.

(
        cls, shape_id: int, rId: str, filename: str, cx: Length, cy: Length
    )

Source from the content-addressed store, hash-verified

91
92 @classmethod
93 def new_pic_inline(
94 cls, shape_id: int, rId: str, filename: str, cx: Length, cy: Length
95 ) -> CT_Inline:
96 """Create `wp:inline` element containing a `pic:pic` element.
97
98 The contents of the `pic:pic` element is taken from the argument values.
99 """
100 pic_id = 0 # Word doesn't seem to use this, but does not omit it
101 pic = CT_Picture.new(pic_id, filename, rId, cx, cy)
102 inline = cls.new(cx, cy, shape_id, pic)
103 return inline
104
105 @classmethod
106 def _inline_xml(cls):

Callers 1

add_pictureMethod · 0.45

Calls 1

newMethod · 0.45

Tested by

no test coverage detected