Поделиться через


Path Class

Shape Path.When the object is serialized out as xml, its qualified name is a:path.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Drawing.Path

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

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(CubicBezierCurveTo))> _
<ChildElementInfoAttribute(GetType(LineTo))> _
<ChildElementInfoAttribute(GetType(MoveTo))> _
<ChildElementInfoAttribute(GetType(QuadraticBezierCurveTo))> _
<ChildElementInfoAttribute(GetType(CloseShapePath))> _
<ChildElementInfoAttribute(GetType(ArcTo))> _
Public Class Path _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As Path
[ChildElementInfoAttribute(typeof(CubicBezierCurveTo))]
[ChildElementInfoAttribute(typeof(LineTo))]
[ChildElementInfoAttribute(typeof(MoveTo))]
[ChildElementInfoAttribute(typeof(QuadraticBezierCurveTo))]
[ChildElementInfoAttribute(typeof(CloseShapePath))]
[ChildElementInfoAttribute(typeof(ArcTo))]
public class Path : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • CloseShapePath <a:close>

  • MoveTo <a:moveTo>

  • LineTo <a:lnTo>

  • ArcTo <a:arcTo>

  • QuadraticBezierCurveTo <a:quadBezTo>

  • CubicBezierCurveTo <a:cubicBezTo>

[ISO/IEC 29500-1 1st Edition]

20.1.9.15 path (Shape Path)

This element specifies a creation path consisting of a series of moves, lines and curves that when combined forms a geometric shape. This element is only utilized if a custom geometry is specified.

[Note: Since multiple paths are allowed the rules for drawing are that the path specified later in the pathLst is drawn on top of all previous paths. end note]

[Example: Consider the following DrawingML.

<a:custGeom>
<a:pathLst>
<a:path w="2824222" h="590309">
<a:moveTo>
<a:pt x="0" y="428263"/>
</a:moveTo>
<a:lnTo>
<a:pt x="1620455" y="590309"/>
</a:lnTo>
      <a:lnTo>
<a:pt x="2824222" y="173620"/>
</a:lnTo>
      <a:lnTo>
<a:pt x="1562582" y="0"/>
</a:lnTo>
<a:close/>
</a:path>
</a:pathLst>
</a:custGeom>

In the above example there is specified a four sided geometric shape that has all straight sides. While we only see three lines being drawn via the lnTo element there are actually four sides because the last point of (x=1562585, y=0) is connected to the first point in the creation path via a lnTo element. end example]

Parent Elements

pathLst (§20.1.9.16)

Child Elements

Subclause

arcTo (Draw Arc To)

§20.1.9.4

close (Close Shape Path)

§20.1.9.6

cubicBezTo (Draw Cubic Bezier Curve To)

§20.1.9.7

lnTo (Draw Line To)

§20.1.9.13

moveTo (Move Path To)

§20.1.9.14

quadBezTo (Draw Quadratic Bezier Curve To)

§20.1.9.21

Attributes

Description

extrusionOk (3D Extrusion Allowed)

Specifies that the use of 3D extrusions are possible on this path. This allows the generating application to know whether 3D extrusion can be applied in any form. If this attribute is omitted then a value of 0, or false is assumed.

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

fill (Path Fill)

Specifies how the corresponding path should be filled. If this attribute is omitted, a value of "norm" is assumed.

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

h (Path Height)

Specifies the height, or maximum y coordinate that should be used for within the path coordinate system. This value determines the vertical placement of all points within the corresponding path as they are all calculated using this height attribute as the max y coordinate.

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

stroke (Path Stroke)

Specifies if the corresponding path should have a path stroke shown. This is a boolean value that affect the outline of the path. If this attribute is omitted, a value of true is assumed.

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

w (Path Width)

Specifies the width, or maximum x coordinate that should be used for within the path coordinate system. This value determines the horizontal placement of all points within the corresponding path as they are all calculated using this width attribute as the max x coordinate.

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

[Note: The W3C XML Schema definition of this element’s content model (CT_Path2D) 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

Path Members

DocumentFormat.OpenXml.Drawing Namespace