Exemple #1
0
        public NonPlaceholderGroupedTransform(OpenXmlCompositeElement xmlElement, P.GroupShape groupShape)
        {
            var offset         = xmlElement.Descendants <A.Offset>().First(); //TODO: make lazy
            var transformGroup = groupShape.GroupShapeProperties.TransformGroup;

            X = offset.X - transformGroup.ChildOffset.X + transformGroup.Offset.X;
            Y = offset.Y - transformGroup.ChildOffset.Y + transformGroup.Offset.Y;

            var extents = xmlElement.Descendants <A.Extents>().First();

            Width  = extents.Cx.Value;
            Height = extents.Cy.Value;
        }
Exemple #2
0
 public static P.NonVisualDrawingProperties GetNonVisualDrawingProperties(
     this OpenXmlCompositeElement compositeElement)
 {
     // Get <p:cNvSpPr>
     return(compositeElement switch
     {
         P.GraphicFrame pGraphicFrame => pGraphicFrame.NonVisualGraphicFrameProperties
         .NonVisualDrawingProperties,
         P.Shape pShape => pShape.NonVisualShapeProperties.NonVisualDrawingProperties,
         P.Picture pPicture => pPicture.NonVisualPictureProperties.NonVisualDrawingProperties,
         P.GroupShape pGroupShape => pGroupShape.NonVisualGroupShapeProperties.NonVisualDrawingProperties,
         _ => throw new ShapeCrawlerException()
     });