[Table of Contents] [docx version]
VML Reference Material - VML
This element adds shadow effects to a shape. The on attribute must be true for the shadow to be displayed.
[Example:
<v:shadow on="true" type="perspective"
matrix="1.25,-2,,1.5,,.000001"
offset="38pt,-6pt">
</v:shadow>
end example]
Parent Elements |
arc (§6.1.2.1); background (§2.2.1); curve (§6.1.2.3); group (§6.1.2.7); image (§6.1.2.10); line (§6.1.2.12); object (§2.3.3.19); oval (§6.1.2.13); pict (§2.3.3.21); pict (§2.9.23); polyline (§6.1.2.15); rect (§6.1.2.16); roundrect (§6.1.2.17); shape (§6.1.2.19); shapedefaults (§6.2.2.27); shapetype (§6.1.2.20) |
Attributes |
Description | ||||||||||||||
color (Shadow Primary Color) |
Specifies the color of the primary shadow. Default is gray (RGB 128,128,128).
[Example:
<v:shadow on="true" color="green"> </v:shadow>
Applied to a simple square the shadow looks like this:
end example]
The possible values for this attribute are defined by the ST_ColorType simple type (§6.1.3.1). | ||||||||||||||
color2 (Shadow Secondary Color) |
Specifies the color of the second shadow, or highlight in an embossed or engraved shadow. Default is light gray (RGB 203,203,203).
[Example:
<v:shadow on="true" type="double" color="green" color2="blue"> </v:shadow>
end example]
The possible values for this attribute are defined by the ST_ColorType simple type (§6.1.3.1). | ||||||||||||||
id (Unique Identifier) |
Specifies a unique identifier that can be used to reference a VML object.
Default is no value.
[Example:
<v:shape ... id="myShape" ... > </v:shape>
end example]
The possible values for this attribute are defined by the XML Schema string datatype. | ||||||||||||||
matrix (Shadow Perspective Matrix) |
Specifies a perspective transform for a shadow. Default is no value.
The matrix is given in the form "" where s = scale and p = perspective. If the offset attribute is in absolute units then are in 1/EMU units; otherwise they are an inverse fraction of the shape size.
[Example: The following snippets explain the matrix parameters. The shadow is applied to a simple square with no fill and a red stroke color (note there is a default shadow offset):
matrix=",,,,,"
specify scaling factors for the x and y dimensions:
matrix="2,,,,,"
matrix=",,,2,,"
specify skews in the x and y dimensions:
matrix=",2,,,,"
matrix=",,-2,,,"
effectively set the perspective trapezoid skews along the x and y dimensions:
matrix=",,,,.000001,"
matrix=",,,,,-.000002"
end example]
[Example:
<v:shadow on="true" type="perspective" matrix="1.25,-2,,1.5,,.000001" offset="38pt,-6pt"> </v:shadow>
end example]
The possible values for this attribute are defined by the XML Schema string datatype. | ||||||||||||||
obscured (Shadow Transparency) |
Specifies whether a shadow is transparent. Default is false. If true, the shadow is transparent if there is no fill on the shape.
[Example:
<v:background fillcolor="yellow"/> <v:shape style="width:50;height:50" filled="false" fillcolor="red" path="m 0,0 l 0,1000 1000,1000 1000,0 x e"> <v:shadow on="true" offset="50%,25%" obscured="true"> </v:shadow> </v:shape>
end example]
The possible values for this attribute are defined by the ST_TrueFalse simple type (§6.1.3.14). | ||||||||||||||
offset (Shadow Primary Offset) |
Specifies the primary shadow's x,y offset from the shape's location. Default is "2pt,2pt".
Values are either an absolute measurement or a fractional value of the shape dimensions, from –50% to 50%.
[Example:
<v:shadow on="true" offset="50%,25%"> </v:shadow>
end example]
The possible values for this attribute are defined by the XML Schema string datatype. | ||||||||||||||
offset2 (Shadow Secondary Offset) |
Specifies the secondary shadow's x,y offset from the shape's location. Default is "-2pt,-2pt".
[Example:
<v:shadow type="double" on="true" color="blue" offset="10pt,5pt" color2="red" offset2="-10pt,-5pt"> </v:shadow>
end example]
The possible values for this attribute are defined by the XML Schema string datatype. | ||||||||||||||
on (Shadow Toggle) |
Specifies whether to show a shadow. Default is true.
The possible values for this attribute are defined by the ST_TrueFalse simple type (§6.1.3.14). | ||||||||||||||
opacity (Shadow Opacity) |
Specifies the opacity of the shadow. Default is 1. This numeric value may also be specified in 1/65536-ths if a trailing "f" is supplied. For example, a value of "52429f" represents 52429/65536 or 0.8.
[Example:
<v:shadow type="double" on="true" opacity=".5" color="blue" offset="10pt,5pt" color2="red" offset2="-10pt,-5pt"> </v:shadow>
end example]
The possible values for this attribute are defined by the XML Schema string datatype. | ||||||||||||||
origin (Shadow Origin) |
Specifies the center of the shadow relative to the shape's origin. Specified as a pair of fractional values of the shape dimensions, ranging from 50% to -50%. Default is "0,0".
[Example: This example is unchanged from above except for the addition of the origin attribute:
<v:shadow on="true" type="perspective" matrix="1.25,-2,,1.5,,.000001" offset="38pt,-6pt" origin="10%,-10%"> </v:shadow>
end example]
The possible values for this attribute are defined by the XML Schema string datatype. | ||||||||||||||
type (Shadow Type) |
Specifies the type of shadow. Default is single. Allowed values are:
The possible values for this attribute are defined by the ST_ShadowType simple type (§6.1.3.7). |
The following XML Schema fragment defines the contents of this element:
<complexType name="CT_Shadow">
<attributeGroup ref="AG_Id"/>
<attribute name="on" type="ST_TrueFalse" use="optional"/>
<attribute name="type" type="ST_ShadowType" use="optional"/>
<attribute name="obscured" type="ST_TrueFalse" use="optional"/>
<attribute name="color" type="ST_ColorType" use="optional"/>
<attribute name="opacity" type="xsd:string" use="optional"/>
<attribute name="offset" type="xsd:string" use="optional"/>
<attribute name="color2" type="ST_ColorType" use="optional"/>
<attribute name="offset2" type="xsd:string" use="optional"/>
<attribute name="origin" type="xsd:string" use="optional"/>
<attribute name="matrix" type="xsd:string" use="optional"/>
</complexType>