Return a newly-created `w:inline` element. The element contains the image specified by `image_descriptor` and is scaled based on the values of `width` and `height`.
(
self,
image_descriptor: str | IO[bytes],
width: int | Length | None = None,
height: int | Length | None = None,
)
| 58 | return self._document_part.get_style_id(style_or_name, style_type) |
| 59 | |
| 60 | def new_pic_inline( |
| 61 | self, |
| 62 | image_descriptor: str | IO[bytes], |
| 63 | width: int | Length | None = None, |
| 64 | height: int | Length | None = None, |
| 65 | ) -> CT_Inline: |
| 66 | """Return a newly-created `w:inline` element. |
| 67 | |
| 68 | The element contains the image specified by `image_descriptor` and is scaled |
| 69 | based on the values of `width` and `height`. |
| 70 | """ |
| 71 | rId, image = self.get_or_add_image(image_descriptor) |
| 72 | cx, cy = image.scaled_dimensions(width, height) |
| 73 | shape_id, filename = self.next_id, image.filename |
| 74 | return CT_Inline.new_pic_inline(shape_id, rId, filename, cx, cy) |
| 75 | |
| 76 | @property |
| 77 | def next_id(self) -> int: |