ShapeBase

Overview

ShapeBase is a class in Aspose.Words FOSS for .NET. Inherits from: CompositeNode, IInline, IShape, and 7 more.

Base class for objects in the drawing layer, such as an AutoShape, freeform, OLE object, ActiveX control, or picture.

This class provides 28 methods for working with ShapeBase objects in .NET programs. Available methods include: Accept, AcceptEnd, AcceptStart, AdjustWithEffects, AppendChild, Clone, CreateNavigator, GetAncestor, GetAncestorOf, GetChild, GetChildNodes, GetEnumerator, and 16 additional methods. All public members are accessible to any .NET application after installing the Aspose.Words FOSS for .NET package. Properties: AllowOverlap, AlternativeText, AnchorLocked, AspectRatioLocked, BehindText, Bottom, and 71 more.

Properties

NameTypeAccessDescription
FillFillReadGets fill formatting for the shape.
ShadowFormatShadowFormatReadGets shadow formatting for the shape.
GlowGlowFormatReadGets glow formatting for the shape.
ReflectionReflectionFormatReadGets reflection formatting for the shape.
SoftEdgeSoftEdgeFormatReadGets soft edge formatting for the shape.
ScreenTipstringRead/WriteDefines the text displayed when the mouse pointer moves over the shape.
HRefstringRead/WriteGets or sets the full hyperlink address for a shape.
TargetstringRead/WriteGets or sets the target frame for the shape hyperlink.
AlternativeTextstringRead/WriteDefines alternative text to be displayed instead of a graphic.
IsDecorativeboolRead/WriteGets or sets the flag that specifies whether the shape is decorative in the document.
TitlestringRead/WriteGets or sets the title (caption) of the current shape object.
NamestringRead/WriteGets or sets the optional shape name.
IsInsertRevisionboolReadGets the is insert revision.
IsDeleteRevisionboolReadGets the is delete revision.
IsMoveFromRevisionboolReadGets the is move from revision.
IsMoveToRevisionboolReadGets the is move to revision.
IsTopLevelboolReadReturns true if this shape is not a child of a group shape.
IsGroupboolReadReturns true if this is a group shape.
IsImageboolReadReturns true if this shape is an image shape.
IsHorizontalRuleboolReadReturns true if this shape is a horizontal rule.
IsWordArtboolReadReturns true if this shape is a WordArt object.
CanHaveImageboolReadReturns true if the shape type allows the shape to have an image.
AnchorLockedboolRead/WriteSpecifies whether the shape’s anchor is locked.
AspectRatioLockedboolRead/WriteSpecifies whether the shape’s aspect ratio is locked.
AllowOverlapboolRead/WriteGets or sets a value that specifies whether this shape can overlap other shapes.
BehindTextboolRead/WriteSpecifies whether the shape is below or above text.
IsInlineboolReadA quick way to determine if this shape is positioned inline with text.
LeftdoubleRead/WriteGets or sets the position of the left edge of the containing block of the shape.
TopdoubleRead/WriteGets or sets the position of the top edge of the containing block of the shape.
RightdoubleReadGets the position of the right edge of the containing block of the shape.
BottomdoubleReadGets the position of the bottom edge of the containing block of the shape.
WidthdoubleRead/WriteGets or sets the width of the containing block of the shape.
HeightdoubleRead/WriteGets or sets the height of the containing block of the shape.
DistanceTopdoubleRead/WriteReturns or sets the distance (in points) between the document text and the top edge of the shape.
DistanceBottomdoubleRead/WriteReturns or sets the distance (in points) between the document text and the bottom edge of the shape.
DistanceLeftdoubleRead/WriteReturns or sets the distance (in points) between the document text and the left edge of the shape.
DistanceRightdoubleRead/WriteReturns or sets the distance (in points) between the document text and the right edge of the shape.
RotationdoubleRead/WriteDefines the angle (in degrees) that a shape is rotated.
ZOrderintRead/WriteDetermines the display order of overlapping shapes.
ParentParagraphParagraphReadReturns the immediate parent paragraph.
BoundsRectangleFRead/WriteGets or sets the location and size of the containing block of the shape.
BoundsInPointsRectangleFReadGets the location and size of the containing block of the shape in points, relative to the anchor of the topmost shape.
BoundsWithEffectsRectangleFReadGets final extent that this shape object has after applying drawing effects.
ShapeTypeShapeTypeReadGets the shape type.
MarkupLanguageShapeMarkupLanguageReadGets MarkupLanguage used for this graphic object.
SizeInPointsSizeFReadGets the size of the shape in points.
FlipOrientationFlipOrientationRead/WriteSwitches the orientation of a shape.
RelativeHorizontalPositionRelativeHorizontalPositionRead/WriteSpecifies relative to what the shape is positioned horizontally.
RelativeVerticalPositionRelativeVerticalPositionRead/WriteSpecifies relative to what the shape is positioned vertically.
RelativeHorizontalSizeRelativeHorizontalSizeRead/WriteGets or sets the value of shape’s relative size in horizontal direction.
RelativeVerticalSizeRelativeVerticalSizeRead/WriteGets or sets the value of shape’s relative size in vertical direction.
LeftRelativefloatRead/WriteGets or sets the value that represents shape’s relative left position in percent.
TopRelativefloatRead/WriteGets or sets the value that represents shape’s relative top position in percent.
HeightRelativefloatRead/WriteGets or sets the value that represents the percentage of shape’s relative height.
WidthRelativefloatRead/WriteGets or sets the value that represents the percentage of shape’s relative width.
HorizontalAlignmentHorizontalAlignmentRead/WriteSpecifies how the shape is positioned horizontally.
VerticalAlignmentVerticalAlignmentRead/WriteSpecifies how the shape is positioned vertically.
WrapTypeWrapTypeRead/WriteDefines whether the shape is inline or floating.
WrapSideWrapSideRead/WriteSpecifies how the text is wrapped around the shape.
CoordOriginPointRead/WriteThe coordinates at the top-left corner of the containing block of this shape.
CoordSizeSizeRead/WriteThe width and height of the coordinate space inside the containing block of this shape.
FontFontReadProvides access to the font formatting of this object.
IsSignatureLineboolReadIndicates that shape is a SignatureLine.
IsLayoutInCellboolRead/WriteGets or sets a flag indicating whether the shape is displayed inside a table or outside of it.
HiddenboolRead/WriteGets or sets a boolean value indicating whether the shape is visible.
IsCompositeboolReadReturns true as this node can have child nodes.
HasChildNodesboolReadReturns true if this node has any child nodes.
FirstChildNodeReadGets the first child of the node.
LastChildNodeReadGets the last child of the node.
CountintReadGets the number of immediate children of this node.
NodeTypeNodeTypeReadGets the type of this node.
ParentNodeCompositeNodeReadGets the immediate parent of this node.
DocumentDocumentBaseReadGets the document to which this node belongs.
PreviousSiblingNodeReadGets the node immediately preceding this node.
NextSiblingNodeReadGets the node immediately following this node.
RangeRangeReadReturns a Range object that represents the portion of a document that is contained in this node.
CustomNodeIdintRead/WriteSpecifies custom node identifier.

Methods

SignatureDescription
LocalToParent(value: PointF)Converts a value from the local coordinate space into the coordinate space of the parent shape.
AdjustWithEffects(source: RectangleF)Adds to the source rectangle values of the effect extent and returns the final rectangle.
GetText()Gets the text of this node and of all its children.
GetChildNodes(nodeType: NodeType, isDeep: bool)Returns a collection of child nodes that match the specified type.
GetChild(nodeType: NodeType, index: int, isDeep: bool)Returns an Nth child node that matches the specified type.
SelectNodes(xpath: string)Selects a list of nodes matching the XPath expression.
SelectSingleNode(xpath: string)Selects the first Node that matches the XPath expression.
GetEnumerator()Provides support for the for each style iteration over the child nodes of this node.
AppendChild(newChild: T)Adds the specified node to the end of the list of child nodes for this node.
PrependChild(newChild: T)Adds the specified node to the beginning of the list of child nodes for this node.
InsertAfter(newChild: T, refChild: Node)Inserts the specified node immediately after the specified reference node.
InsertBefore(newChild: T, refChild: Node)Inserts the specified node immediately before the specified reference node.
RemoveChild(oldChild: T)Removes the specified child node.
RemoveAllChildren()Removes all the child nodes of the current node.
RemoveSmartTags()Removes all SmartTag descendant nodes of the current node.
IndexOf(child: Node)Returns the index of the specified child node in the child node array.
AcceptStart(visitor: DocumentVisitor)When implemented in a derived class, calls the VisitXXXStart method of the specified document visitor.
AcceptEnd(visitor: DocumentVisitor)When implemented in a derived class, calls the VisitXXXEnd method of the specified document visitor.
CreateNavigator()Creates navigator which can be used to traverse and read nodes.
Clone(isCloneChildren: bool)You should use the Clone(bool, INodeCloningListener) overload when the node cloning is a part of another (usually composite) node cloning process.
Accept(visitor: DocumentVisitor)Calls Accept(visitor) on this ShapeBase instance.
GetAncestor(ancestorType: Type)Gets the first ancestor of the specified object type.
GetAncestorOf()Calls GetAncestorOf on this ShapeBase instance.
Remove()Removes itself from the parent.
NextPreOrder(rootNode: Node)Gets next node according to the pre-order tree traversal algorithm.
PreviousPreOrder(rootNode: Node)Gets the previous node according to the pre-order tree traversal algorithm.
ToString(saveFormat: SaveFormat)Exports the content of the node into a string in the specified format.
NodeTypeToString(nodeType: NodeType)A utility method that converts a node type enum value into a user friendly string.

See Also