Class ShapeContent
Represents a shape within the document, primarily defined using SVG format.
Inheritance
System.Object
ShapeContent
Implements
IronSoftware.Abstractions.Word.IShape
IronSoftware.Abstractions.Word.IWordDocumentObject
IronSoftware.Abstractions.IDocumentObject
System.ICloneable
IronSoftware.Abstractions.IColored
IronSoftware.Abstractions.Word.IWordAbsolute
IronSoftware.Abstractions.IAbsolute
IronSoftware.Abstractions.IJsonSerializable
Assembly: IronWord.dll
Syntax
public class ShapeContent : ContentElement, IWordShapeObject, IShape, IWordDocumentObject, IDocumentObject, ICloneable, IColored, IWordAbsolute, IAbsolute, IJsonSerializable
Constructors
ShapeContent(ShapeType, RectangleF)
Initialize a ShapeContent object.
Declaration
public ShapeContent(ShapeType shapeType, RectangleF boundingBox)
Parameters
| Type |
Name |
Description |
| IronSoftware.Abstractions.Word.ShapeType |
shapeType |
The type of shape.
|
| System.Drawing.RectangleF |
boundingBox |
The bounding box of the shape.
|
ShapeContent(ShapeType, RectangleF, Color, Color)
Initialize a ShapeContent object.
Declaration
public ShapeContent(ShapeType shapeType, RectangleF boundingBox, Color fillColor, Color strokeColor)
Parameters
| Type |
Name |
Description |
| IronSoftware.Abstractions.Word.ShapeType |
shapeType |
The type of shape.
|
| System.Drawing.RectangleF |
boundingBox |
The bounding box of the shape.
|
| Color |
fillColor |
The fill color.
|
| Color |
strokeColor |
The stroke color.
|
ShapeContent(List<IPathSegment>)
Initialize a ShapeContent object.
Declaration
public ShapeContent(List<IPathSegment> points)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<IronSoftware.Abstractions.IPathSegment> |
points |
The points of the shape.
|
ShapeContent(List<IPathSegment>, Color, Color)
Initialize a ShapeContent object.
Declaration
public ShapeContent(List<IPathSegment> points, Color fillColor, Color strokeColor)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<IronSoftware.Abstractions.IPathSegment> |
points |
The points of the shape.
|
| Color |
fillColor |
The fill color.
|
| Color |
strokeColor |
The stroke color.
|
Properties
Angle
Gets or sets rotation Angle for the shape in the document.
Declaration
public double Angle { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
BoundingBox
The bounding box of the shape.
Declaration
public RectangleF BoundingBox { get; set; }
Property Value
| Type |
Description |
| System.Drawing.RectangleF |
|
DistanceFromBottom
Gets or sets the distance from the bottom edge of the document to the Shape measured in points (1 inch = 72 points).
Declaration
public double DistanceFromBottom { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
DistanceFromLeft
Gets or sets the distance from the left edge of the document to the Shape measured in points (1 inch = 72 points).
Declaration
public double DistanceFromLeft { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
DistanceFromRight
Gets or sets the distance from the right edge of the document to the Shape measured in points (1 inch = 72 points).
Declaration
public double DistanceFromRight { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
DistanceFromTop
Gets or sets the distance from the top edge of the document to the Shape measured in points (1 inch = 72 points).
Declaration
public double DistanceFromTop { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
FillColor
Gets or sets the fill color of the shape.
Declaration
public Color FillColor { get; set; }
Property Value
FlipHorizontal
Flip the shape horizontally.
Declaration
public bool FlipHorizontal { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
FlipVertical
Flip the shape vertically.
Declaration
public bool FlipVertical { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
Height
The height of the shape in pts.
Declaration
public double Height { get; }
Property Value
| Type |
Description |
| System.Double |
|
HorizontalAlignment
Gets or sets the horizontal alignment of the shape within its containing element.
Declaration
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
| Type |
Description |
| IronSoftware.Abstractions.Word.HorizontalAlignment |
|
HorizontalRelativePositionOrigin
Declaration
public HorizontalRelativePositionOrigin HorizontalRelativePositionOrigin { get; set; }
Property Value
| Type |
Description |
| IronSoftware.Abstractions.Word.HorizontalRelativePositionOrigin |
|
Id
Gets or sets a unique identifier for the shape in the document.
Declaration
public uint Id { get; set; }
Property Value
| Type |
Description |
| System.UInt32 |
|
Index
The index of this ShapeContent in Children.
Declaration
public int Index { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
Name
Gets or sets the Name of the shape in the document.
Declaration
public string Name { get; set; }
Property Value
| Type |
Description |
| System.String |
|
Points
The points that make up the shape.
Declaration
public List<IPathSegment> Points { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.List<IronSoftware.Abstractions.IPathSegment> |
|
StrokeColor
Gets or sets the Stroke Color of the shape.
Declaration
public Color StrokeColor { get; set; }
Property Value
StrokeWeight
The stroke weight of the shape in points (1 inch = 72 points).
Declaration
public int StrokeWeight { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
TextWrapBehavior
Declaration
public ITextWrapBehavior TextWrapBehavior { get; set; }
Property Value
| Type |
Description |
| IronSoftware.Abstractions.Word.ITextWrapBehavior |
|
Type
Declaration
public ShapeType Type { get; set; }
Property Value
| Type |
Description |
| IronSoftware.Abstractions.Word.ShapeType |
|
VerticalAlignment
Gets or sets the vertical alignment of the shape within its containing element.
Declaration
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
| Type |
Description |
| IronSoftware.Abstractions.Word.VerticalAlignment |
|
VerticalRelativePositionOrigin
Declaration
public VerticalRelativePositionOrigin VerticalRelativePositionOrigin { get; set; }
Property Value
| Type |
Description |
| IronSoftware.Abstractions.Word.VerticalRelativePositionOrigin |
|
Width
The width of the shape in pts.
Declaration
public double Width { get; }
Property Value
| Type |
Description |
| System.Double |
|
ZOrder
Declaration
public RelativeZOrder ZOrder { get; set; }
Property Value
| Type |
Description |
| IronSoftware.Abstractions.RelativeZOrder |
|
ZPosition
Declaration
public long ZPosition { get; set; }
Property Value
| Type |
Description |
| System.Int64 |
|
Methods
GetDistanceFromBottom(MeasurementUnit)
Declaration
public double GetDistanceFromBottom(MeasurementUnit measurementUnit)
Parameters
Returns
| Type |
Description |
| System.Double |
|
GetDistanceFromLeft(MeasurementUnit)
Declaration
public double GetDistanceFromLeft(MeasurementUnit measurementUnit)
Parameters
Returns
| Type |
Description |
| System.Double |
|
GetDistanceFromRight(MeasurementUnit)
Declaration
public double GetDistanceFromRight(MeasurementUnit measurementUnit)
Parameters
Returns
| Type |
Description |
| System.Double |
|
GetDistanceFromTop(MeasurementUnit)
Declaration
public double GetDistanceFromTop(MeasurementUnit measurementUnit)
Parameters
Returns
| Type |
Description |
| System.Double |
|
GetHeight(MeasurementUnit)
Declaration
public double GetHeight(MeasurementUnit measurementUnit)
Parameters
Returns
| Type |
Description |
| System.Double |
|
GetWidth(MeasurementUnit)
Get the width of the shape in specified measurement unit.
Declaration
public double GetWidth(MeasurementUnit measurementUnit)
Parameters
Returns
| Type |
Description |
| System.Double |
|
Resize(Int32, Int32)
Declaration
public void Resize(int width, int height)
Parameters
| Type |
Name |
Description |
| System.Int32 |
width |
New width in points (1 inch = 72 points).
|
| System.Int32 |
height |
New height in points (1 inch = 72 points).
|
Rotate(Double)
Rotates the shape by a specified angle.
Declaration
public void Rotate(double angle)
Parameters
| Type |
Name |
Description |
| System.Double |
angle |
The angle in degrees.
|
SetDistanceFromBottom(Double, MeasurementUnit)
Declaration
public void SetDistanceFromBottom(double distanceFromBottom, MeasurementUnit measurementUnit)
Parameters
| Type |
Name |
Description |
| System.Double |
distanceFromBottom |
|
| MeasurementUnit |
measurementUnit |
|
SetDistanceFromLeft(Double, MeasurementUnit)
Declaration
public void SetDistanceFromLeft(double distanceFromLeft, MeasurementUnit measurementUnit)
Parameters
| Type |
Name |
Description |
| System.Double |
distanceFromLeft |
|
| MeasurementUnit |
measurementUnit |
|
SetDistanceFromRight(Double, MeasurementUnit)
Declaration
public void SetDistanceFromRight(double distanceFromRight, MeasurementUnit measurementUnit)
Parameters
| Type |
Name |
Description |
| System.Double |
distanceFromRight |
|
| MeasurementUnit |
measurementUnit |
|
SetDistanceFromTop(Double, MeasurementUnit)
Declaration
public void SetDistanceFromTop(double distanceFromTop, MeasurementUnit measurementUnit)
Parameters
| Type |
Name |
Description |
| System.Double |
distanceFromTop |
|
| MeasurementUnit |
measurementUnit |
|
SetHeight(Double, MeasurementUnit)
Declaration
public void SetHeight(double height, MeasurementUnit measurementUnit)
Parameters
SetWidth(Double, MeasurementUnit)
Declaration
public void SetWidth(double width, MeasurementUnit measurementUnit)
Parameters
ToJson()
Serialize this shape as a JSON object.
Declaration
Returns
| Type |
Description |
| System.String |
|
Implements
IronSoftware.Abstractions.Word.IShape
IronSoftware.Abstractions.Word.IWordDocumentObject
IronSoftware.Abstractions.IDocumentObject
System.ICloneable
IronSoftware.Abstractions.IColored
IronSoftware.Abstractions.Word.IWordAbsolute
IronSoftware.Abstractions.IAbsolute
IronSoftware.Abstractions.IJsonSerializable