Search Results for

    Show / Hide Table of Contents

    Class ShapeContent

    Represents a shape within the document, primarily defined using SVG format.

    Inheritance
    System.Object
    ContentElement
    ShapeContent
    Implements
    IronSoftware.Abstractions.IDocumentElement
    IWordPathObject
    IWordDocumentObject
    IronSoftware.IDocumentObject
    IronSoftware.IDocumentPathObject
    IronSoftware.IBoundedDocumentObject
    IronSoftware.IBounded
    IronSoftware.ITransformable
    IronSoftware.IColored
    System.ICloneable
    IronSoftware.Abstractions.IDocumentLayoutFriendly
    IronSoftware.IJsonSerializable
    Inherited Members
    ContentElement.Status
    ContentElement.Replace(ContentElement)
    ContentElement.Remove()
    ContentElement.GetIndex<T>()
    ContentElement.Clone()
    ContentElement.CloneObject()
    ContentElement.Parent
    Namespace: IronWord.Models
    Assembly: IronWord.dll
    Syntax
    public class ShapeContent : ContentElement, IDocumentElement, IWordPathObject, IWordDocumentObject, IDocumentObject, IDocumentPathObject, IBoundedDocumentObject, IBounded, ITransformable, IColored, ICloneable, IDocumentLayoutFriendly, IJsonSerializable

    Constructors

    ShapeContent()

    Initializes a new instance of the Shape class.

    Declaration
    public ShapeContent()

    ShapeContent(ShapeType, RectangleF, Color, Color)

    Create new shape content using the specified parameters

    Declaration
    public ShapeContent(ShapeType Type, RectangleF Bounds, Color FillColor, Color StrokeColor)
    Parameters
    Type Name Description
    ShapeType Type

    Preset shape type

    System.Drawing.RectangleF Bounds

    Shape position and size

    Color FillColor

    Shape fill color

    Color StrokeColor

    Shape stroke color

    Properties

    AnchorOrigin

    Declaration
    public LayoutAnchorOrigins AnchorOrigin { get; set; }
    Property Value
    Type Description
    IronSoftware.Abstractions.LayoutAnchorOrigins

    AnchorStyle

    Declaration
    public LayoutAnchorStyles AnchorStyle { get; set; }
    Property Value
    Type Description
    IronSoftware.Abstractions.LayoutAnchorStyles

    Angle

    Gets or sets rotation Angle for the shape in the document.

    Declaration
    public double Angle { get; set; }
    Property Value
    Type Description
    System.Double
    Remarks

    Unit are 'degrees' with range of values between 0 and 360, any negative or larger values will be normalized to that range.

    BoundingBox

    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

    DocumentId

    Declaration
    public IDocumentId DocumentId { get; set; }
    Property Value
    Type Description
    IronSoftware.IDocumentId

    FillColor

    Gets or sets the Fill Color of the shape.

    Declaration
    public Color FillColor { get; set; }
    Property Value
    Type Description
    Color

    FillMode

    Declaration
    public PathFillModes FillMode { get; set; }
    Property Value
    Type Description
    IronSoftware.PathFillModes

    Height

    Gets or sets the height of the shape in points (1 inch = 72 points).

    Declaration
    public double Height { get; set; }
    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
    HorizontalAlignment

    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 Shape in parent Children list.

    Declaration
    public int Index { get; set; }
    Property Value
    Type Description
    System.Int32

    IsStroked

    Declaration
    public bool IsStroked { get; set; }
    Property Value
    Type Description
    System.Boolean

    Matrix

    Declaration
    public MatrixStruct Matrix { get; }
    Property Value
    Type Description
    IronSoftware.MatrixStruct

    Name

    Gets or sets the Name of the shape in the document.

    Declaration
    public string Name { get; set; }
    Property Value
    Type Description
    System.String

    ObjNum

    Declaration
    public uint ObjNum { get; set; }
    Property Value
    Type Description
    System.UInt32

    PageIndex

    Declaration
    public uint PageIndex { get; set; }
    Property Value
    Type Description
    System.UInt32

    Points

    Declaration
    public IReadOnlyCollection<IPathSegment> Points { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyCollection<IronSoftware.IPathSegment>

    Rotation

    Declaration
    public double Rotation { get; set; }
    Property Value
    Type Description
    System.Double

    Scale

    Declaration
    public PointF Scale { get; set; }
    Property Value
    Type Description
    System.Drawing.PointF

    StrokeColor

    Gets or sets the Stroke Color of the shape.

    Declaration
    public Color StrokeColor { get; set; }
    Property Value
    Type Description
    Color

    StrokeWeight

    Gets or sets the StrokeWeight of the shape in points (1 inch = 72 points).

    Declaration
    public int StrokeWeight { get; set; }
    Property Value
    Type Description
    System.Int32

    Translate

    Declaration
    public PointF Translate { get; set; }
    Property Value
    Type Description
    System.Drawing.PointF

    Type

    Gets or sets the Type of the shape.

    Declaration
    public ShapeType Type { get; set; }
    Property Value
    Type Description
    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
    VerticalAlignment

    Width

    Gets or sets the width of the shape in points (1 inch = 72 points).

    Declaration
    public double Width { get; set; }
    Property Value
    Type Description
    System.Double

    WrapText

    Gets or sets the text wrapping behavior around the shape.

    Declaration
    public WrapText WrapText { get; set; }
    Property Value
    Type Description
    WrapText

    ZOrder

    Declaration
    public LayoutZOrders ZOrder { get; set; }
    Property Value
    Type Description
    IronSoftware.Abstractions.LayoutZOrders

    Methods

    FlipHorizontal()

    Flips the shape horizontally.

    Declaration
    public void FlipHorizontal()

    FlipVertical()

    Flips the shape vertically.

    Declaration
    public void FlipVertical()

    GetDistanceFromBottom(MeasurementUnit)

    Declaration
    public double GetDistanceFromBottom(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit
    Returns
    Type Description
    System.Double

    GetDistanceFromLeft(MeasurementUnit)

    Declaration
    public double GetDistanceFromLeft(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit
    Returns
    Type Description
    System.Double

    GetDistanceFromRight(MeasurementUnit)

    Declaration
    public double GetDistanceFromRight(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit
    Returns
    Type Description
    System.Double

    GetDistanceFromTop(MeasurementUnit)

    Declaration
    public double GetDistanceFromTop(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit
    Returns
    Type Description
    System.Double

    GetHeight(MeasurementUnit)

    Declaration
    public double GetHeight(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit
    Returns
    Type Description
    System.Double

    GetWidth(MeasurementUnit)

    Get Shape width in English Metric MeasurementUnit

    Declaration
    public double GetWidth(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit
    Returns
    Type Description
    System.Double

    Shape width in English Metric MeasurementUnit

    Resize(Int32, Int32)

    Resizes the shape.

    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.

    Remarks

    Unit are 'degrees' with range of values between 0 and 360, any negative or larger values will be normalized to that range.

    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
    Type Name Description
    System.Double height
    MeasurementUnit measurementUnit

    SetWidth(Double, MeasurementUnit)

    Declaration
    public void SetWidth(double width, MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    System.Double width
    MeasurementUnit measurementUnit

    ToJson()

    Declaration
    public string ToJson()
    Returns
    Type Description
    System.String

    Implements

    IronSoftware.Abstractions.IDocumentElement
    IWordPathObject
    IWordDocumentObject
    IronSoftware.IDocumentObject
    IronSoftware.IDocumentPathObject
    IronSoftware.IBoundedDocumentObject
    IronSoftware.IBounded
    IronSoftware.ITransformable
    IronSoftware.IColored
    System.ICloneable
    IronSoftware.Abstractions.IDocumentLayoutFriendly
    IronSoftware.IJsonSerializable

    Inherited members

    Status
    Replace(ContentElement)
    Remove()
    GetIndex<T>()
    Clone()
    CloneObject()
    Parent
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet
    Want to deploy IronWord to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronWord free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.