예제 #1
0
 def new(cls, pic_id, filename, rId, cx, cy):
     """
     Return a new ``<pic:pic>`` element populated with the minimal
     contents required to define a viable picture element, based on the
     values passed as parameters.
     """
     pic = OxmlElement('pic:pic', nsmap=nspfxmap('pic', 'r'))
     pic.append(CT_PictureNonVisual.new(pic_id, filename))
     pic.append(CT_BlipFillProperties.new(rId))
     pic.append(CT_ShapeProperties.new(cx, cy))
     return pic
예제 #2
0
 def new(cls, pic_id, filename, rId, cx, cy):
     """
     Return a new ``<pic:pic>`` element populated with the minimal
     contents required to define a viable picture element, based on the
     values passed as parameters.
     """
     pic = OxmlElement('pic:pic', nsmap=nspfxmap('pic', 'r'))
     pic.append(CT_PictureNonVisual.new(pic_id, filename))
     pic.append(CT_BlipFillProperties.new(rId))
     pic.append(CT_ShapeProperties.new(cx, cy))
     return pic
예제 #3
0
    def new(cls, cx, cy, shape_id, pic):
        """
        Return a new ``<wp:inline>`` element populated with the values passed
        as parameters.
        """
        name = 'Picture %d' % shape_id
        uri = nsmap['pic']

        inline = OxmlElement('wp:inline', nsmap=nspfxmap('wp', 'r'))
        inline.append(CT_PositiveSize2D.new('wp:extent', cx, cy))
        inline.append(CT_NonVisualDrawingProps.new('wp:docPr', shape_id, name))
        inline.append(CT_GraphicalObject.new(uri, pic))
        return inline
예제 #4
0
    def new(cls, cx, cy, shape_id, pic):
        """
        Return a new ``<wp:inline>`` element populated with the values passed
        as parameters.
        """
        name = 'Picture %d' % shape_id
        uri = nsmap['pic']

        inline = OxmlElement('wp:inline', nsmap=nspfxmap('wp', 'r'))
        inline.append(CT_PositiveSize2D.new('wp:extent', cx, cy))
        inline.append(CT_NonVisualDrawingProps.new(
            'wp:docPr', shape_id, name
        ))
        inline.append(CT_GraphicalObject.new(uri, pic))
        return inline