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
    IWordShapeObject
    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
    Inherited Members
    ContentElement.Replace(IWordDocumentObject)
    ContentElement.Remove()
    ContentElement.GetIndex<T>()
    ContentElement.Clone()
    ContentElement.CloneObject()
    ContentElement.Parent
    ContentElement.Status
    Namespace: IronWord.Models
    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.

    Remarks

    Initializing with just points will set the ShapeType as "Custom".

    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
    Remarks

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

    BoundingBox

    The bounding box of the shape.

    Declaration
    public RectangleF BoundingBox { get; set; }
    Property Value
    Type Description
    System.Drawing.RectangleF
    Remarks

    Position and dimensions are represented in pts.

    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
    Type Description
    Color

    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
    Type Description
    Color

    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
    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 the width of the shape in specified measurement unit.

    Declaration
    public double GetWidth(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit

    Measurement unit.

    Returns
    Type Description
    System.Double

    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 is 'degrees' with a 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()

    Serialize this shape as a JSON object.

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

    Implements

    IWordShapeObject
    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

    Inherited members

    Replace(IWordDocumentObject)
    Remove()
    GetIndex<T>()
    Clone()
    CloneObject()
    Parent
    Status
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet
    IronWord_for_dotnet_log2o
    Blue key in circleGet started for FREE
    No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet started for FREE
    The trial form was submitted successfully.
    Calendar in circleBook Free Live Demo
    No contact, no card details, no commitments Book a 30-minute, personal demo.
    Here's what to expect:

    A live demo of our product and its key features

    Get project specific feature recommendations

    All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation
    Support Team Member 6 related to The C# PDF Library Support Team Member 14 related to The C# PDF Library Support Team Member 4 related to The C# PDF Library Support Team Member 2 related to The C# PDF Library
    Online 24/5
    Need help? Our sales team would be glad to help you.
    Try the Enterprise Trial
    ironpdf_for_dotnet_log2o
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    bullet_checkedNo credit card or account creation required
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    Blue key in circleNo credit card or account creation required
    Green Check in orange circle
    The trial form was submitted successfully.
    badge_greencheck_in_yellowcircle
    Thank you for starting a trial

    Please check your email for the trial license key.

    If you don’t receive an email, please start a live chat or email support@ironsoftware.com

    Install with NuGet
    View Licensing
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronWord