a:sp (Shape)

Represents a shape object in DrawingML, including rectangles, ellipses, and preset shapes with geometry and appearance properties.

Description

a:sp is the DrawingML shape element that represents a visual shape object. It is defined in ECMA-376 Part 1 §20.1.2.5.1.

Shapes are fundamental drawing objects that can be rectangles, circles, ellipses, or custom geometries. Every shape has geometry (defining the visual outline), visual properties (fill, line, shadow), and optional text body for text content. Shapes can be nested within group shapes.

Attributes

Attribute Type Possible Values Description
(none) - - All properties are defined through child elements.

Examples

Rectangle Shape with Blue Fill

<p:sp xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
  <p:nvSpPr>
    <p:cNvPr id="1" name="Rectangle 1"/>
    <p:cNvSpPr/>
    <p:nvPr/>
  </p:nvSpPr>
  <p:spPr>
    <a:xfrm>
      <a:off x="1000" y="1000"/>
      <a:ext cx="2000000" cy="1000000"/>
    </a:xfrm>
    <a:prstGeom prst="rect">
      <a:avLst/>
    </a:prstGeom>
    <a:solidFill>
      <a:srgbClr val="0070C0"/>
    </a:solidFill>
  </p:spPr>
  <p:txBody>
    <a:bodyPr/>
    <a:lstStyle/>
    <a:p/>
  </p:txBody>
</p:sp>

Ellipse with Red Outline

<p:sp xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
  <p:nvSpPr>
    <p:cNvPr id="2" name="Ellipse 1"/>
    <p:cNvSpPr/>
    <p:nvPr/>
  </p:nvSpPr>
  <p:spPr>
    <a:xfrm>
      <a:off x="2000000" y="2000000"/>
      <a:ext cx="1500000" cy="1500000"/>
    </a:xfrm>
    <a:prstGeom prst="ellipse">
      <a:avLst/>
    </a:prstGeom>
    <a:noFill/>
    <a:ln w="50800">
      <a:solidFill>
        <a:srgbClr val="FF0000"/>
      </a:solidFill>
    </a:ln>
  </p:spPr>
  <p:txBody>
    <a:bodyPr/>
    <a:lstStyle/>
    <a:p/>
  </p:txBody>
</p:sp>

Notes

  • Every shape must have non-visual properties, shape properties, and a text body
  • Preset geometries (rectangle, ellipse, triangle) are easier than custom geometries
  • Shapes can be positioned and sized using transform properties
  • Text body can be empty if shape doesn’t contain text
  • Outline width is in EMUs (914400 EMUs = 1 inch)