ShapeStyle Class

Shape Style.When the object is serialized out as xml, its qualified name is p:style.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Presentation.ShapeStyle

Namespace:  DocumentFormat.OpenXml.Presentation
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(LineReference))> _
<ChildElementInfoAttribute(GetType(FillReference))> _
<ChildElementInfoAttribute(GetType(EffectReference))> _
<ChildElementInfoAttribute(GetType(FontReference))> _
Public Class ShapeStyle _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As ShapeStyle
[ChildElementInfoAttribute(typeof(LineReference))]
[ChildElementInfoAttribute(typeof(FillReference))]
[ChildElementInfoAttribute(typeof(EffectReference))]
[ChildElementInfoAttribute(typeof(FontReference))]
public class ShapeStyle : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • DocumentFormat.OpenXml.Drawing.LineReference <a:lnRef>

  • DocumentFormat.OpenXml.Drawing.FillReference <a:fillRef>

  • DocumentFormat.OpenXml.Drawing.EffectReference <a:effectRef>

  • DocumentFormat.OpenXml.Drawing.FontReference <a:fontRef>

[ISO/IEC 29500-1 1st Edition]

19.3.1.46 style (Shape Style)

This element specifies the style information for a shape. This is used to define a shape's appearance in terms of the preset styles defined by the style matrix for the theme.

[Example:

<p:style>
  <a:lnRef idx="3">
    <a:schemeClr val="lt1"/>
  </a:lnRef>
  <a:fillRef idx="1">
    <a:schemeClr val="accent3"/>
  </a:fillRef>
  <a:effectRef idx="1">
    <a:schemeClr val="accent3"/>
  </a:effectRef>
  <a:fontRef idx="minor">
    <a:schemeClr val="lt1"/>
  </a:fontRef>
</p:style>

The parent shape of the above code is to have an outline that uses the third line style defined by the theme, use the first fill defined by the scheme, and be rendered with the first effect defined by the theme. Text inside the shape is to use the minor font defined by the theme.

end example]

Parent Elements

cxnSp (§19.3.1.19); pic (§19.3.1.37); sp (§19.3.1.43)

Child Elements

Subclause

effectRef (Effect Reference)

§20.1.4.2.8

fillRef (Fill Reference)

§20.1.4.2.10

fontRef (Font Reference)

§20.1.4.1.17

lnRef (Line Reference)

§20.1.4.2.19

[Note: The W3C XML Schema definition of this element’s content model (CT_ShapeStyle) is located in §A.4.1. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

ShapeStyle Members

DocumentFormat.OpenXml.Presentation Namespace