PowerPointShape
OfficeIMO.PowerPoint
Base class for shapes used on PowerPoint slides.
Inheritance
- object
- PowerPointShape
Derived Types
Usage
Explore 153 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 110
- Method PowerPointAutoShape.BindToPlaceholder
- Method PowerPointAutoShape.Duplicate
- Method PowerPointAutoShape.MoveBy
- Method PowerPointAutoShape.Resize
- Method PowerPointAutoShape.Scale
- Method PowerPointAutoShape.SetLanguage
- Method PowerPointAutoShape.SetPosition
- Method PowerPointAutoShape.SetSize
- Method PowerPointChart.BindToPlaceholder
- Method PowerPointChart.Duplicate
- Method PowerPointChart.MoveBy
- Method PowerPointChart.Resize
- Method PowerPointChart.Scale
- Method PowerPointChart.SetLanguage
- Method PowerPointChart.SetPosition
- Method PowerPointChart.SetSize
- Method PowerPointConnectionShape.BindToPlaceholder
- Method PowerPointConnectionShape.Duplicate
- Method PowerPointConnectionShape.MoveBy
- Method PowerPointConnectionShape.Resize
- Method PowerPointConnectionShape.Scale
- Method PowerPointConnectionShape.SetLanguage
- Method PowerPointConnectionShape.SetPosition
- Method PowerPointConnectionShape.SetSize
- Property PowerPointConnectionShape.EndShape
- Property PowerPointConnectionShape.StartShape
- Method PowerPointGroupShape.BindToPlaceholder
- Method PowerPointGroupShape.Duplicate
- Method PowerPointGroupShape.MoveBy
- Method PowerPointGroupShape.Resize
- Method PowerPointGroupShape.Scale
- Method PowerPointGroupShape.SetLanguage
- Method PowerPointGroupShape.SetPosition
- Method PowerPointGroupShape.SetSize
- Method PowerPointImage.BindToPlaceholder
- Method PowerPointImage.Duplicate
- Method PowerPointImage.MoveBy
- Method PowerPointImage.Resize
- Method PowerPointImage.Scale
- Method PowerPointImage.SetLanguage
- Method PowerPointImage.SetPosition
- Method PowerPointImage.SetSize
- Property PowerPointMasterSurface.Shapes
- Method PowerPointMedia.BindToPlaceholder
- Method PowerPointMedia.Duplicate
- Method PowerPointMedia.MoveBy
- Method PowerPointMedia.Resize
- Method PowerPointMedia.Scale
- Method PowerPointMedia.SetLanguage
- Method PowerPointMedia.SetPosition
- Method PowerPointMedia.SetSize
- Method PowerPointOleObject.BindToPlaceholder
- Method PowerPointOleObject.Duplicate
- Method PowerPointOleObject.MoveBy
- Method PowerPointOleObject.Resize
- Method PowerPointOleObject.Scale
- Method PowerPointOleObject.SetLanguage
- Method PowerPointOleObject.SetPosition
- Method PowerPointOleObject.SetSize
- Method PowerPointShape.BindToPlaceholder
- Method PowerPointShape.Duplicate
- Method PowerPointShape.MoveBy
- Method PowerPointShape.Resize
- Method PowerPointShape.Scale
- Method PowerPointShape.SetLanguage
- Method PowerPointShape.SetPosition
- Method PowerPointShape.SetSize
- Method PowerPointSlide.DuplicateShape
- Method PowerPointSlide.EnumerateShapesDeep
- Method PowerPointSlide.GetGroupChildren
- Method PowerPointSlide.GetShape
- Method PowerPointSlide.GetShapeById
- Method PowerPointSlide.GetShapeByName
- Method PowerPointSlide.GetShapesInBounds
- Method PowerPointSlide.UngroupShape
- Property PowerPointSlide.Shapes
- Method PowerPointSlideCompositionContext.AddCalloutBand
- Method PowerPointSlideCompositionContext.AddCardGrid
- Method PowerPointSlideCompositionContext.AddCoverageMap
- Method PowerPointSlideCompositionContext.AddLogoWall
- Method PowerPointSlideCompositionContext.AddMetricStrip
- Method PowerPointSlideCompositionContext.AddProcessTimeline
- Method PowerPointSlideCompositionContext.AddTitle
- Method PowerPointSlideCompositionContext.AddVisualFrame
- Property PowerPointSlideLayout.Shapes
- Property PowerPointSlideMaster.Shapes
- Method PowerPointSmartArt.BindToPlaceholder
- Method PowerPointSmartArt.Duplicate
- Method PowerPointSmartArt.MoveBy
- Method PowerPointSmartArt.Resize
- Method PowerPointSmartArt.Scale
- Method PowerPointSmartArt.SetLanguage
- Method PowerPointSmartArt.SetPosition
- Method PowerPointSmartArt.SetSize
- Method PowerPointTable.BindToPlaceholder
- Method PowerPointTable.Duplicate
- Method PowerPointTable.MoveBy
- Method PowerPointTable.Resize
- Method PowerPointTable.Scale
- Method PowerPointTable.SetLanguage
- Method PowerPointTable.SetPosition
- Method PowerPointTable.SetSize
- Method PowerPointTextBox.BindToPlaceholder
- Method PowerPointTextBox.Duplicate
- Method PowerPointTextBox.MoveBy
- Method PowerPointTextBox.Resize
- Method PowerPointTextBox.Scale
- Method PowerPointTextBox.SetLanguage
- Method PowerPointTextBox.SetPosition
- Method PowerPointTextBox.SetSize
Accepted by parameters 43
- Method PowerPointLayoutBox.ApplyTo
- Method PowerPointSlide.AddClassicAnimation
- Method PowerPointSlide.AddCommandAnimation
- Method PowerPointSlide.AddConnector
- Method PowerPointSlide.AddConnector
- Method PowerPointSlide.AddMotionAnimation
- Method PowerPointSlide.AddRotationAnimation
- Method PowerPointSlide.AlignShapes
- Method PowerPointSlide.AlignShapesToSlide
- Method PowerPointSlide.AlignShapesToSlideContent
- Method PowerPointSlide.ArrangeShapesInGrid
- Method PowerPointSlide.ArrangeShapesInGridAuto
- Method PowerPointSlide.ArrangeShapesInGridAutoToSlide
- Method PowerPointSlide.ArrangeShapesInGridAutoToSlideContent
- Method PowerPointSlide.ArrangeShapesInGridToSlide
- Method PowerPointSlide.ArrangeShapesInGridToSlideContent
- Method PowerPointSlide.BringForward
- Method PowerPointSlide.BringToFront
- Method PowerPointSlide.ClearClassicAnimationSound
- Method PowerPointSlide.DistributeShapes
- Method PowerPointSlide.DistributeShapesToSlide
- Method PowerPointSlide.DistributeShapesToSlideContent
- Method PowerPointSlide.DistributeShapesWithSpacing
- Method PowerPointSlide.DistributeShapesWithSpacingToSlide
- Method PowerPointSlide.DistributeShapesWithSpacingToSlideContent
- Method PowerPointSlide.DuplicateShape
- Method PowerPointSlide.EnumerateShapesDeep
- Method PowerPointSlide.FitShapesToBounds
- Method PowerPointSlide.FitShapesToSlide
- Method PowerPointSlide.FitShapesToSlideContent
- Method PowerPointSlide.GetClassicAnimationSoundBytes
- Method PowerPointSlide.GroupShapes
- Method PowerPointSlide.RemoveClassicAnimation
- Method PowerPointSlide.RemoveShape
- Method PowerPointSlide.ResizeShapes
- Method PowerPointSlide.SendBackward
- Method PowerPointSlide.SendToBack
- Method PowerPointSlide.SetClassicAnimationSound
- Method PowerPointSlide.SetClassicAnimationStopsSound
- Method PowerPointSlide.StackShapes
- Method PowerPointSlide.StackShapesToSlide
- Method PowerPointSlide.StackShapesToSlideContent
- Method PowerPointSlide.TryGetShapeByName
Methods
public PowerPointShape BindToPlaceholder(PowerPointPlaceholderType placeholderType, uint? index = null) #Places this text box, picture, table or chart into a placeholder of the slide's layout, the way PowerPoint does when content is inserted into a placeholder, and keeps the placeholder binding. A text box inherits the placeholder's position, size and text formatting from the layout, so later layout edits still apply; a picture or chart takes the placeholder's position and size (pictures are cropped to fill it), and a table spans its width with its own row heights. An empty slide instance of the placeholder is replaced.
Parameters
- placeholderType OfficeIMO.PowerPoint.PowerPointPlaceholderType
- Layout placeholder type, such as PowerPointPlaceholderType.Picture or PowerPointPlaceholderType.Object.
- index uint? = null
- Placeholder index when the layout has several placeholders of the type.
Returns
PowerPointShapepublic void BringToFront() #Moves the shape to the front (top) of the z-order within its parent.
public void ClearClickSound() #Removes the sound played when this shape is clicked.
public void ClearHyperlink() #Removes the click hyperlink from this shape.
public void ClearMouseOverSound() #Removes the sound played when the pointer enters this shape.
public void ClearReflection() #Removes any reflection effect from the shape.
public void ClearSoftEdges() #Removes any soft edges effect from the shape.
public PowerPointShape Duplicate(OfficeLength offsetX = default, OfficeLength offsetY = default) #Duplicates this shape on its owning slide.
Parameters
- offsetX OfficeIMO.OfficeLength = default
- offsetY OfficeIMO.OfficeLength = default
Returns
PowerPointShapepublic byte[]? GetClickSoundBytes() #Returns the exact embedded click-sound bytes, when present.
Returns
byte[]?public byte[]? GetMouseOverSoundBytes() #Returns the exact embedded mouse-over-sound bytes, when present.
Returns
byte[]?public PowerPointShape MoveBy(OfficeLength offsetX, OfficeLength offsetY) #Moves the shape by the specified offsets with explicit lengths.
Parameters
- offsetX OfficeIMO.OfficeLength
- offsetY OfficeIMO.OfficeLength
Returns
PowerPointShapepublic void MoveToReadingOrder(int order) #Moves the shape to a zero-based shape-tree reading order within its current parent.
Parameters
- order int
public void Remove() #Removes this shape from its owning slide or parent shape tree.
public PowerPointShape Resize(OfficeLength width, OfficeLength height, PowerPointShapeAnchor anchor = TopLeft) #Resizes the shape while keeping the specified anchor fixed.
Parameters
- width OfficeIMO.OfficeLength
- height OfficeIMO.OfficeLength
- anchor OfficeIMO.PowerPoint.PowerPointShapeAnchor = TopLeft
Returns
PowerPointShapepublic PowerPointShape Scale(double scale, PowerPointShapeAnchor anchor = Center) #Scales the shape uniformly using the specified anchor.
Parameters
- scale double
- anchor OfficeIMO.PowerPoint.PowerPointShapeAnchor = Center
Returns
PowerPointShapepublic PowerPointShape Scale(double scaleX, double scaleY, PowerPointShapeAnchor anchor = Center) #Scales the shape using separate X/Y factors and the specified anchor.
Parameters
- scaleX double
- scaleY double
- anchor OfficeIMO.PowerPoint.PowerPointShapeAnchor = Center
Returns
PowerPointShapepublic void SendToBack() #Moves the shape to the back (bottom) of the z-order within its parent.
public void SetBlur(OfficeLength radius, bool grow = false) #Applies a blur effect to the shape.
Parameters
- radius OfficeIMO.OfficeLength
- grow bool = false
public void SetClickSound(Stream audio, string name, string contentType = "audio/wav", string extension = ".wav") #Sets an embedded WAV or AIFF sound played when this shape is clicked.
Parameters
- audio System.IO.Stream
- name string
- contentType string = "audio/wav"
- extension string = ".wav"
public void SetClickStopsSound(bool value) #Controls whether clicking this shape stops the currently playing sound.
Parameters
- value bool
public void SetGlow(OfficeColor color, OfficeLength? radius = null, int transparencyPercent = 30) #Applies a glow effect to the shape.
Parameters
- color OfficeIMO.OfficeColor
- radius OfficeIMO.OfficeLength? = null
- transparencyPercent int = 30
public void SetHyperlink(Uri uri, string? tooltip = null) #Sets an external or internal-slide click hyperlink on this shape.
Parameters
- uri System.Uri
- Absolute hyperlink target or a valid #slide-N fragment.
- tooltip string? = null
- Optional screen tip.
public void SetHyperlink(PowerPointSlide targetSlide, string? tooltip = null) #Sets an internal click hyperlink to another slide in the same presentation.
Parameters
- targetSlide OfficeIMO.PowerPoint.PowerPointSlide
- Target slide.
- tooltip string? = null
- Optional screen tip.
public PowerPointShape SetLanguage(string language) #Applies a BCP 47 language tag to every text run and paragraph end marker in this shape.
Parameters
- language string
Returns
PowerPointShapepublic void SetLineEnds(OfficeLineMarkerKind? startType, OfficeLineMarkerKind? endType, PowerPointLineEndWidth? width = null, PowerPointLineEndLength? length = null) #Sets arrowheads for line-based shapes.
Parameters
- startType OfficeIMO.Drawing.OfficeLineMarkerKind?
- endType OfficeIMO.Drawing.OfficeLineMarkerKind?
- width OfficeIMO.PowerPoint.PowerPointLineEndWidth? = null
- length OfficeIMO.PowerPoint.PowerPointLineEndLength? = null
public void SetMouseOverSound(Stream audio, string name, string contentType = "audio/wav", string extension = ".wav") #Sets an embedded WAV or AIFF sound played when the pointer enters this shape.
Parameters
- audio System.IO.Stream
- name string
- contentType string = "audio/wav"
- extension string = ".wav"
public void SetMouseOverStopsSound(bool value) #Controls whether entering this shape stops the currently playing sound.
Parameters
- value bool
public PowerPointShape SetPosition(OfficeLength left, OfficeLength top) #Sets position with explicit lengths.
Parameters
- left OfficeIMO.OfficeLength
- top OfficeIMO.OfficeLength
Returns
PowerPointShapepublic void SetReflection(OfficeLength? blur = null, OfficeLength? distance = null, double directionDegrees = 270, double fadeDirectionDegrees = 90, int startOpacityPercent = 50, int endOpacityPercent = 0, int startPositionPercent = 0, int endPositionPercent = 100, PowerPointRectangleAlignment? alignment = null, bool rotateWithShape = false) #Applies a reflection effect to the shape.
Parameters
- blur OfficeIMO.OfficeLength? = null
- distance OfficeIMO.OfficeLength? = null
- directionDegrees double = 270
- fadeDirectionDegrees double = 90
- startOpacityPercent int = 50
- endOpacityPercent int = 0
- startPositionPercent int = 0
- endPositionPercent int = 100
- alignment OfficeIMO.PowerPoint.PowerPointRectangleAlignment? = null
- rotateWithShape bool = false
public void SetShadow(OfficeColor color, OfficeLength? blur = null, OfficeLength? distance = null, double angleDegrees = 45, int transparencyPercent = 35, bool rotateWithShape = false) #Applies a drop shadow to the shape.
Parameters
- color OfficeIMO.OfficeColor
- blur OfficeIMO.OfficeLength? = null
- distance OfficeIMO.OfficeLength? = null
- angleDegrees double = 45
- transparencyPercent int = 35
- rotateWithShape bool = false
public PowerPointShape SetSize(OfficeLength width, OfficeLength height) #Sets size with explicit lengths.
Parameters
- width OfficeIMO.OfficeLength
- height OfficeIMO.OfficeLength
Returns
PowerPointShapepublic void SetSoftEdges(OfficeLength radius) #Applies a soft edges effect to the shape.
Parameters
- radius OfficeIMO.OfficeLength
Inherited Methods
Properties
public string? Title { get; set; } #Gets or sets the concise accessibility title stored in the shape's non-visual properties.
public bool Decorative { get; set; } #Gets or sets whether assistive technology should treat this shape as decorative.
public int ReadingOrder { get; } #Zero-based shape-tree order used by PowerPoint accessibility and drawing-order tools.
public string? Language { get; } #Gets the first explicit BCP 47 language tag found in this shape's text.
public IReadOnlyList<string> Languages { get; } #Gets the distinct explicit language tags found in this shape's text.
public OfficeColor? FillColor { get; set; } #Gets or sets the local fill color, retaining native theme slots and opacity.
public int? FillTransparency { get; set; } #Gets or sets the fill transparency percentage (0-100). 0 = opaque, 100 = fully transparent.
public double? Rotation { get; set; } #Gets or sets rotation in degrees.
public bool? HorizontalFlip { get; set; } #Gets or sets horizontal flip.
public bool? VerticalFlip { get; set; } #Gets or sets vertical flip.
public uint? Id { get; } #Numeric shape identifier stored in the PowerPoint non-visual drawing properties.
public string? AltText { get; set; } #Alternative text description assigned to the shape.
public Uri? Hyperlink { get; set; } #Click hyperlink assigned to the shape, when present. Internal slide links are returned as stable Markdown-compatible fragments such as #slide-2.
public PowerPointPlaceholderType? ShapePlaceholderType { get; } #Placeholder type associated with the shape, if any.
public uint? ShapePlaceholderIndex { get; } #Placeholder index associated with the shape, if any.
public PowerPointPlaceholderSize? ShapePlaceholderSize { get; } #Preferred placeholder size associated with the shape, if any.
public PowerPointPlaceholderDirection? ShapePlaceholderOrientation { get; } #Placeholder orientation associated with the shape, if any.
public PowerPointShapeContentType ShapeContentType { get; } #Primary content type represented by this shape wrapper.
public int DrawingOrder { get; } #Zero-based drawing order within the parent shape tree, where larger values render above earlier shapes.
public IReadOnlyList<PowerPointConnectionSite> ConnectionSites { get; } #Connection sites where connectors can be glued, in slide coordinates. Empty when the geometry declares no sites this library can resolve.
public PowerPointLayoutBox Bounds { get; set; } #Gets or sets the shape bounds.
public OfficeColor? OutlineColor { get; set; } #Gets or sets the local outline color, retaining native theme slots and opacity.
public int? OutlineTransparency { get; set; } #Gets or sets the outline transparency percentage (0-100). 0 is opaque and 100 is fully transparent.
public OfficeLength? OutlineWidth { get; set; } #Gets or sets the outline width.
public PowerPointLineDashStyle? OutlineDash { get; set; } #Gets or sets the outline dash preset.
public string? ClickSoundName { get; } #Gets the sound name played when this shape is clicked.
public string? MouseOverSoundName { get; } #Gets the sound name played when the pointer enters this shape.