Exemplo n.º 1
0
 def new_pic_anchor(cls, shape_id, rId, filename, cx, cy, pos_x, pos_y):
     """
     Return a new `wp:anchor` element containing the `pic:pic` element
     specified by the argument values.
     """
     pic_id = 0  # Word doesn't seem to use this, but does not omit it
     pic = CT_Picture.new(pic_id, filename, rId, cx, cy)
     anchor = cls.new(cx, cy, shape_id, pic, pos_x, pos_y)
     anchor.graphic.graphicData._insert_pic(pic)
     return anchor
Exemplo n.º 2
0
 def new_picture(cls, r, image_part, rId, shape_id):
     """
     Return a new |InlineShape| instance containing an inline picture
     placement of *image_part* appended to run *r* and uniquely identified
     by *shape_id*.
     """
     cx, cy, filename = (
         image_part.default_cx, image_part.default_cy, image_part.filename
     )
     pic_id = 0
     pic = CT_Picture.new(pic_id, filename, rId, cx, cy)
     inline = CT_Inline.new(cx, cy, shape_id, pic)
     r.add_drawing(inline)
     return cls(inline)