Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PowerPointShape

OfficeIMO.PowerPoint

Namespace
OfficeIMO.PowerPoint
Assembly
OfficeIMO.PowerPoint
Source revision
0eef6a5756b9 with working tree changes
Modifiers
abstract

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

Accepted by parameters 43

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 required
Layout placeholder type, such as PowerPointPlaceholderType.Picture or PowerPointPlaceholderType.Object.
index uint? = null optional
Placeholder index when the layout has several placeholders of the type.
public void BringToFront() #

Moves the shape to the front (top) of the z-order within its parent.

public void ClearBlur() #

Removes any blur effect from the shape.

public void ClearClickSound() #

Removes the sound played when this shape is clicked.

public void ClearGlow() #

Removes any glow effect from the 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 ClearShadow() #

Removes any drop shadow 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 optional
offsetY OfficeIMO.OfficeLength = default optional
public 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 required
offsetY OfficeIMO.OfficeLength required
public void MoveToReadingOrder(int order) #

Moves the shape to a zero-based shape-tree reading order within its current parent.

Parameters

order int required
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 required
height OfficeIMO.OfficeLength required
anchor OfficeIMO.PowerPoint.PowerPointShapeAnchor = TopLeft optional
Scale 2 overloads
public PowerPointShape Scale(double scale, PowerPointShapeAnchor anchor = Center) #

Scales the shape uniformly using the specified anchor.

Parameters

scale double required
anchor OfficeIMO.PowerPoint.PowerPointShapeAnchor = Center optional
public PowerPointShape Scale(double scaleX, double scaleY, PowerPointShapeAnchor anchor = Center) #

Scales the shape using separate X/Y factors and the specified anchor.

Parameters

scaleX double required
scaleY double required
anchor OfficeIMO.PowerPoint.PowerPointShapeAnchor = Center optional
public 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 required
grow bool = false optional
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 required
name string required
contentType string = "audio/wav" optional
extension string = ".wav" optional
public void SetClickStopsSound(bool value) #

Controls whether clicking this shape stops the currently playing sound.

Parameters

value bool required
public void SetGlow(OfficeColor color, OfficeLength? radius = null, int transparencyPercent = 30) #

Applies a glow effect to the shape.

Parameters

color OfficeIMO.OfficeColor required
radius OfficeIMO.OfficeLength? = null optional
transparencyPercent int = 30 optional
SetHyperlink 2 overloads
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 required
public void SetLineEnds(OfficeLineMarkerKind? startType, OfficeLineMarkerKind? endType, PowerPointLineEndWidth? width = null, PowerPointLineEndLength? length = null) #

Sets arrowheads for line-based shapes.

Parameters

startType OfficeIMO.Drawing.OfficeLineMarkerKind? required
endType OfficeIMO.Drawing.OfficeLineMarkerKind? required
width OfficeIMO.PowerPoint.PowerPointLineEndWidth? = null optional
length OfficeIMO.PowerPoint.PowerPointLineEndLength? = null optional
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 required
name string required
contentType string = "audio/wav" optional
extension string = ".wav" optional
public void SetMouseOverStopsSound(bool value) #

Controls whether entering this shape stops the currently playing sound.

Parameters

value bool required
public PowerPointShape SetPosition(OfficeLength left, OfficeLength top) #

Sets position with explicit lengths.

Parameters

left OfficeIMO.OfficeLength required
top OfficeIMO.OfficeLength required
public 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 optional
distance OfficeIMO.OfficeLength? = null optional
directionDegrees double = 270 optional
fadeDirectionDegrees double = 90 optional
startOpacityPercent int = 50 optional
endOpacityPercent int = 0 optional
startPositionPercent int = 0 optional
endPositionPercent int = 100 optional
alignment OfficeIMO.PowerPoint.PowerPointRectangleAlignment? = null optional
rotateWithShape bool = false optional
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 required
blur OfficeIMO.OfficeLength? = null optional
distance OfficeIMO.OfficeLength? = null optional
angleDegrees double = 45 optional
transparencyPercent int = 35 optional
rotateWithShape bool = false optional
public PowerPointShape SetSize(OfficeLength width, OfficeLength height) #

Sets size with explicit lengths.

Parameters

width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
public void SetSoftEdges(OfficeLength radius) #

Applies a soft edges effect to the shape.

Parameters

radius OfficeIMO.OfficeLength required

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? Name { get; set; } #

Name assigned to the shape.

public string? AltText { get; set; } #

Alternative text description assigned to the shape.

public bool Hidden { get; set; } #

Gets or sets whether the shape is hidden.

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 OfficeLength Left { get; set; } #

Left of the shape.

public OfficeLength Top { get; set; } #

Top of the shape.

public OfficeLength Width { get; set; } #

Width of the shape.

public OfficeLength Height { get; set; } #

Height of the shape.

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 OfficeLength Right { get; set; } #

Right of the shape.

public OfficeLength Bottom { get; set; } #

Bottom of the shape.

public OfficeLength CenterX { get; set; } #

CenterX of the shape.

public OfficeLength CenterY { get; set; } #

CenterY of the shape.

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.