[Table of Contents] [docx version]

VML Reference Material - VML

stroke (Line Stroke Settings)

This element describes how to draw the path if something beyond solid line with a solid color is desired.  The attributes of the stroke element can be used to describe a powerful set of stroke properties.   Extensions to the VML stroke definition are encoded as sub-elements of stroke.

[Example:

<v:polyline points="0pt,0pt,50pt,0pt,50pt,35pt,15pt,35pt,

15pt,15pt,75pt,15pt">

<v:stroke startarrow="classic" endarrow="classic"

startarrowwidth="wide" endarrowwidth="wide" dashstyle="dashdot"

weight="2pt" color="teal" linestyle="thinThin"/>

</v:polyline>

end example]

Parent Elements

arc6.1.2.1); background2.2.1); curve6.1.2.3); group6.1.2.7); image6.1.2.10); line6.1.2.12); object2.3.3.19); oval6.1.2.13); pict2.3.3.21); pict2.9.23); polyline6.1.2.15); rect6.1.2.16); roundrect6.1.2.17); shape6.1.2.19); shapedefaults6.2.2.27); shapetype6.1.2.20)

 

Child Elements

Subclause

bottom (Text Box Bottom Stroke)

§6.2.2.1

column (Text Box Interior Stroke)

§6.2.2.6

left (Text Box Left Stroke)

§6.2.2.15

right (Text Box Right Stroke)

§6.2.2.25

top (Text Box Top Stroke)

§6.2.2.31

 

Attributes

Description

althref (Alternate Image Reference)

 

Namespace: urn:schemas-microsoft-com:office:office

Specifies an alternate reference for an image in Macintosh PICT format.

 

[Example:

 

<v:stroke ... althref="myimage.pcz" ... >

</v:stroke>

 

end example]

 

The possible values for this attribute are defined by the XML Schema string datatype.

color (Stroke Color)

Specifies the stroke color. Overrides the strokecolor attribute of a shape. Default is black. See the fillcolor attribute for a list of supported named colors.

 

[Example: The shape stroke is blue:

 

<v:shape ... strokecolor="red" ... >

<v:stroke color="blue"/>

</v:shape>

 

end example]

 

The possible values for this attribute are defined by the ST_ColorType simple type (§6.1.3.1).

color2 (Stroke Alternate Pattern Color)

Specifies a second color for strokes, used when filltype is pattern. Default is no value.

 

When a pattern fill is used for the stroke, the stroke color is used in colored parts of the source image. The color2 defines an alternate color to use in place of black in the source image.

 

[Example: This unusual example is intended to demonstrate how the image and colors interact to create a patterned stroke. The yellow background shows transparency. The non-square shape and square image create an effective offset. The heavy stroke weight shows more of the image. The green shape fill shows how the stroke is overlaid on the shape.

 

<v:background fillcolor="yellow"/>

<v:shape style="width:60;height:50"

strokecolor="red" fillcolor="lime"

path="m 0,0 l 0,1000 1000,1000 1000,0 x e">

<v:stroke filltype="pattern" weight="10pt"

src="myimage.gif" color2="blue"/>

</v:shape>

 

, where myimage.gif is:

 

end example]

 

The possible values for this attribute are defined by the ST_ColorType simple type (§6.1.3.1).

dashstyle (Stroke Dash Pattern)

Specifies the dot and dash pattern for a stroke. Default is solid. Pre-defined values are:

 

solid

shortdash

shortdot

shortdashdot

shortdashdotdot

dot

dash

longdash

dashdot

longdashdot

longdashdotdot

 

A custom-defined dash pattern may also be specified using a series of numbers. These define the length of the dash (the drawn part of the stroke) and the length of the space between the dashes. The lengths are relative to the line width: a length of 1 is equal to the line width. The endcap style is applied to each dash but the arrow style is not. The string defines the length of the dash then the length of the space. This may be repeated to form complex dash styles. The string should always contain a pair of numbers; if it contains an odd number of numbers the last is disregarded. 0 implies a dot that is fourfold symmetrical (with round end caps, this is a circle).

 

[Example:

 

<v:stroke dashstyle="0 2" weight="3pt"

endcap="round">

</v:stroke>

 

 

<v:stroke dashstyle="longdashdotdot"

weight="2pt">

</v:stroke>

 

 

end example]

 

The possible values for this attribute are defined by the XML Schema string datatype.

endarrow (Line End Arrowhead)

Specifies an arrowhead for the end of a line. Default is none. Note that the path must not be closed with the x command for the arrowhead to show. Allowed values are:

 

none

block

classic

diamond

oval

open

 

[Example:

 

<v:stroke endarrow="classic"/>

 

 

end example]

 

The possible values for this attribute are defined by the ST_StrokeArrowType simple type (§6.1.3.9).

endarrowlength (Line End Arrowhead Length)

Specifies the length of the arrowhead at the end of a line. Default is medium. Allowed values are:

 

short

medium

long

 

[Example:

 

<v:stroke ... endarrowlength="long" ... />

 

 

end example]

 

The possible values for this attribute are defined by the ST_StrokeArrowLength simple type (§6.1.3.8).

endarrowwidth (Line End Arrowhead Width)

Specifies the width of the arrowhead at the end of a line. Default is medium. Allowed values are:

 

narrow

medium

wide

 

[Example:

 

<v:stroke ... endarrowwidth="wide" ... />

 

 

end example]

 

The possible values for this attribute are defined by the ST_StrokeArrowWidth simple type (§6.1.3.10).

endcap (Line End Cap)

Specifies the cap style for the end of a stroke. Default is flat. Allowed values are:

 

flat

square

round

 

[Example:

 

<v:stroke ... endcap="round" weight="10pt" ... />

 

endcap="flat"

endcap="square"

endcap="round"

 

end example]

 

The possible values for this attribute are defined by the ST_StrokeEndCap simple type (§6.1.3.11).

filltype (Stroke Image Style)

Specifies the type of fill used for the background of a stroke. Default is solid. Allowed values are:

 

solid - The fill pattern is solid.

tile - The fill image is tiled.

pattern - The fill image is stretched to form a pattern.

frame - The fill image becomes a border for the shape.

 

[Example:

 

<v:shape style="width:50;height:50"

strokecolor="red"

path="m 0,0 l 0,1000 1000,1000 1000,0 x e">

<v:stroke filltype="frame" weight="10pt"

src="border.gif"/>

</v:shape>

 

, where border.gif is:

 

end example]

 

The possible values for this attribute are defined by the ST_FillType simple type (§6.1.3.5).

forcedash (Force Dashed Outline)

 

Namespace: urn:schemas-microsoft-com:office:office

Specifies whether a dashed outline is used to draw a shape when a shape has no line or fill. Default is false.

 

Used by PresentationML placeholders to draw a dashed outline when there is no line and no fill for a shape.

 

[Example:

 

<v:shape ... o:forcedash="true" ... >

</v:shape>

 

end example]

 

The possible values for this attribute are defined by the ST_TrueFalse simple type (§6.2.3.23).

href (Original Image Reference)

 

Namespace: urn:schemas-microsoft-com:office:office

Specifies the URL to the original image file. Used only if the picture has been linked and embedded. Default is no value.

 

[Example:

 

<v:fill ... o:href="myimage.gif" ... >

</v:fill>

 

end example]

 

The possible values for this attribute are defined by the XML Schema string datatype.

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.

id (Relationship)

 

Namespace: .../officeDocument/2006/relationships

Specifies the relationship ID of the relationship to the image used for the stroke. The specified relationship shall be of type http://schemas.openxmlformats.org/officeDocument/2006/relationships/image or the document shall be considered non-conformant.

 

[Example: The markup specifies the associated relationship part with relationship ID rId10 contains the corresponding relationship information:

 

< ... r:id="rId10" />

 

end example]

 

The possible values for this attribute are defined by the ST_RelationshipId simple type (§7.8.2.1).

imagealignshape (Stoke Image Alignment)

Specifies the alignment of the stroke image. If true, the image is aligned with the shape. Otherwise, it is aligned with the containing scope. Default is true.

 

[Example: The top position offset shifts the image alignment relative to the containing window:

 

<v:shape fillcolor="silver"

style="top:20;width:50;height:50"

path="m 0,0 l 0,1000 1000,1000 1000,0 x e">

<v:stroke imagealignshape="false" weight="20pt"

filltype="tile" src="myimage.gif"/>

</v:shape>

 

imagealignshape="false"

 

imagealignshape="false"

 

end example]

 

The possible values for this attribute are defined by the ST_TrueFalse simple type (§6.1.3.14).

imageaspect (Stroke Image Aspect Ratio)

Specifies how the stroke image aspect ratio is preserved. Default is ignore. Allowed values are:

 

Value

Description

ignore

Ignore aspect issues.

atleast

Image is at least as big as imagesize.

atmost

Image is no bigger than imagesize.

 

[Example:

 

<v:stroke filltype="frame" weight="10pt"

src="border.gif" imagealignshape="true"

imageaspect="atleast">

</v:stroke>

 

imagealignshape="ignore"

imagealignshape="atleast"

imagealignshape="atmost"

 

end example]

 

The possible values for this attribute are defined by the ST_ImageAspect simple type (§6.1.3.6).

imagesize (Stroke Image Size)

Specifies the size of the image for the stroke. Default is the size of the image.

 

[Example:

 

<v:stroke ... imagesize="10pt,10pt" ... />

 

end example]

 

The possible values for this attribute are defined by the XML Schema string datatype.

insetpen (Inset Border From Path)

Specifies that the border shall be displayed inside of the path defining the shape, rather than along the path (the default border placement), or outside of the path as might be done with an image.

 

[Example:

 

<v:shape ... insetpen="true" ... >

</v:shape>

 

end example]

 

The possible values for this attribute are defined by the ST_TrueFalse simple type (§6.1.3.14).

joinstyle (Line End Join Style)

Specifies the join style for line ends. Default is round.

 

round

bevel

miter

 

[Example:

 

<v:polyline strokeweight="10pt" strokecolor="navy"

points="10pt,10pt,50pt,50pt,90pt,10pt">

<v:stroke joinstyle="bevel"/>

</v:polyline>   

 

joinstyle="round"

joinstyle="bevel"

joinstyle="miter"

 

end example]

 

The possible values for this attribute are defined by the ST_StrokeJoinStyle simple type (§6.1.3.12).

linestyle (Stroke Line Style)

Specifies the line style of the stroke. Default is single.

 

single

thinThin

thinThick

thickThin

thickBetweenThin

 

[Example:

 

<v:stroke linestyle="thickThin" weight="5pt">

</v:stroke>

 

 

end example]

 

The possible values for this attribute are defined by the ST_StrokeLineStyle simple type (§6.1.3.13).

miterlimit (Miter Joint Limit)

Specifies the smoothness of the miter joint, or the maximum distance between the inner point and outer point of a joint. This number is a multiple of the thickness of the line. Default is 8.

 

[Example:

 

<v:stroke joinstyle="miter" weight="10pt"

miterlimit="2">

</v:stroke>

 

 

end example]

 

The possible values for this attribute are defined by the XML Schema decimal datatype.

on (Stroke Toggle)

Specifies whether the stroke is displayed. Default is true. This attribute overrides the shape's stroke attribute.

 

[Example:

 

<v:rect style="width:50;height:50" stroked="true"

fillcolor="lime" strokecolor="red">

<v:stroke on="false" weight="5pt"/>

</v:rect>

 

 

end example]

 

The possible values for this attribute are defined by the ST_TrueFalse simple type (§6.1.3.14).

opacity (Stroke Opacity)

Specifies the amount of transparency of a stroke. Default is 1.0.

 

[Example:

 

<v:rect style="width:50;height:50"

fillcolor="lime" strokecolor="red">

<v:stroke weight="5pt" opacity="50%"/>

</v:rect>

 

 

end example]

 

The possible values for this attribute are defined by the XML Schema string datatype.

relid (Relationship to Part)

 

Namespace: urn:schemas-microsoft-com:office:office

Specifies the relationship ID of the relationship to the image. The specified relationship shall be of type http://schemas.openxmlformats.org/officeDocument/2006/relationships/image or the document shall be considered non-conformant.

 

[Example: The markup specifies the associated relationship part with relationship ID rId10 contains the corresponding relationship information:

 

<v:stroke ... o:relid="rId10" ...>

</v:stroke>

 

end example]

 

The possible values for this attribute are defined by the ST_RelationshipId simple type (§6.2.3.20).

src (Stroke Image Location)

Specifies the source image to load for a stroke fill. Default is no value.

 

[Example:

 

<v:stroke ... src="myimage.gif" ... >

</v:stroke>

 

end example]

 

The possible values for this attribute are defined by the XML Schema string datatype.

startarrow (Line Start Arrowhead)

Specifies an arrowhead for the start of a line. Default is none. Note that the path must not be closed with the x command for the arrowhead to show. Allowed values are:

 

none

block

classic

diamond

oval

open

 

[Example:

 

<v:stroke startarrow="classic"/>

 

 

end example]

 

The possible values for this attribute are defined by the ST_StrokeArrowType simple type (§6.1.3.9).

startarrowlength (Line Start Arrowhead Length)

Specifies the length of the arrowhead at the start of a line. Default is medium. Allowed values are:

 

short

medium

long

 

[Example:

 

<v:stroke ... startarrowlength="long" ... />

 

 

end example]

 

The possible values for this attribute are defined by the ST_StrokeArrowLength simple type (§6.1.3.8).

startarrowwidth (Line Start Arrowhead Width)

Specifies the width of the arrowhead at the start of a line. Default is medium. Allowed values are:

 

narrow

medium

wide

 

[Example:

 

<v:stroke ... startarrowwidth="wide" ... />

 

 

end example]

 

The possible values for this attribute are defined by the ST_StrokeArrowWidth simple type (§6.1.3.10).

title (Stroke Title)

 

Namespace: urn:schemas-microsoft-com:office:office

Specifies the title of an embedded stroke image. This is typically set to the comment property of the image, which is often blank.

 

[Example:

 

<v:fill ... o:title="alt text" ... >

</v:fill>

 

end example]

 

The possible values for this attribute are defined by the XML Schema string datatype.

weight (Stroke Weight)

Specifies the thickness of a stroke. Default is 1. This attribute overrides the shape's strokeweight attribute.

 

The possible values for this attribute are defined by the XML Schema string datatype.

The following XML Schema fragment defines the contents of this element:

<complexType name="CT_Stroke">

   <sequence>

   <element ref="o:left" minOccurs="0"/>

   <element ref="o:top" minOccurs="0"/>

   <element ref="o:right" minOccurs="0"/>

   <element ref="o:bottom" minOccurs="0"/>

   <element ref="o:column" minOccurs="0"/>

   </sequence>

   <attributeGroup ref="AG_Id"/>

   <attributeGroup ref="AG_StrokeAttributes"/>

</complexType>