PowerPointImage
OfficeIMO.PowerPoint
Represents an image placed on a slide.
Inheritance
- PowerPointShape
- PowerPointImage
Derived Types
Usage
Explore 4 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 4
- Method PowerPointSlide.AddImage
- Method PowerPointSlide.GetGroupImages
- Method PowerPointSlide.GetImage
- Property PowerPointSlide.Images
Methods
public void Crop(double leftPercent, double topPercent, double rightPercent, double bottomPercent) #Crops the image by the specified percentages (0-100).
Parameters
- leftPercent double
- topPercent double
- rightPercent double
- bottomPercent double
public void FitToBox(double imageWidth, double imageHeight, bool crop = true) #Fits the image into the current shape bounds, optionally cropping to fill.
Parameters
- imageWidth double
- Source image width (pixels).
- imageHeight double
- Source image height (pixels).
- crop bool = true
- When true, crops to fill the box. When false, resizes to fit.
public void FitToBox() #Fills the current shape bounds using the image's stored pixel size.
public void FitToBox(bool crop) #Fits the image into the current shape bounds using the pixel size stored in the image itself. With crop the picture fills the box and the excess is cropped on the axis where the image is longer; otherwise the frame shrinks to the image's aspect ratio, centred in the box.
Parameters
- crop bool
public byte[] GetImageBytes() #Returns a snapshot of the embedded image bytes for export adapters.
Returns
byte[]public void ResetClassicEffects() #Removes the luminance, grayscale, bi-level, transparent-color, and whole-picture recolor effects supported by binary PowerPoint.
public void UpdateImage(Stream newImage, OfficeImageFormat type) #Replaces the picture's underlying image with the provided stream.
Parameters
- newImage System.IO.Stream
- Stream containing the new image data.
- type OfficeIMO.Drawing.OfficeImageFormat
- Image format of the new image.
public void UpdateImage(string imagePath) #Replaces the picture's underlying image with the provided file.
Parameters
- imagePath string
- Path to the new image file.
Inherited Methods
public PowerPointShape Duplicate(OfficeLength offsetX = default, OfficeLength offsetY = default) #Parameters
- offsetX OfficeLength = default
- offsetY OfficeLength = default
Returns
PowerPointShapepublic void MoveBy(OfficeLength offsetX, OfficeLength offsetY) #Parameters
- offsetX OfficeLength
- offsetY OfficeLength
public void Resize(OfficeLength width, OfficeLength height, PowerPointShapeAnchor anchor = TopLeft) #Parameters
- width OfficeLength
- height OfficeLength
- anchor PowerPointShapeAnchor = TopLeft
public void Scale(double scale, PowerPointShapeAnchor anchor = Center) #Parameters
- scale double
- anchor PowerPointShapeAnchor = Center
public void Scale(double scaleX, double scaleY, PowerPointShapeAnchor anchor = Center) #Parameters
- scaleX double
- scaleY double
- anchor PowerPointShapeAnchor = Center
public void SetBlur(OfficeLength radius, bool grow = false) #Parameters
- radius OfficeLength
- grow bool = false
public void SetClickSound(Stream audio, string name, string contentType = "audio/wav", string extension = ".wav") #Parameters
- audio Stream
- name string
- contentType string = "audio/wav"
- extension string = ".wav"
public void SetGlow(string color, OfficeLength? radius = null, int transparencyPercent = 30) #Parameters
- color string
- radius OfficeLength? = null
- transparencyPercent int = 30
public void SetHyperlink(Uri uri, string? tooltip = null) #Parameters
- uri Uri
- tooltip string? = null
public void SetHyperlink(PowerPointSlide targetSlide, string? tooltip = null) #Parameters
- targetSlide PowerPointSlide
- tooltip string? = null
public PowerPointShape SetLanguage(string language) #Parameters
- language string
Returns
PowerPointShapepublic void SetLineEnds(OfficeLineMarkerKind? startType, OfficeLineMarkerKind? endType, PowerPointLineEndWidth? width = null, PowerPointLineEndLength? length = null) #Parameters
- startType OfficeLineMarkerKind?
- endType OfficeLineMarkerKind?
- width PowerPointLineEndWidth? = null
- length PowerPointLineEndLength? = null
public void SetMouseOverSound(Stream audio, string name, string contentType = "audio/wav", string extension = ".wav") #Parameters
- audio Stream
- name string
- contentType string = "audio/wav"
- extension string = ".wav"
public void SetPosition(OfficeLength left, OfficeLength top) #Parameters
- left OfficeLength
- top OfficeLength
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) #Parameters
- blur OfficeLength? = null
- distance OfficeLength? = null
- directionDegrees double = 270
- fadeDirectionDegrees double = 90
- startOpacityPercent int = 50
- endOpacityPercent int = 0
- startPositionPercent int = 0
- endPositionPercent int = 100
- alignment PowerPointRectangleAlignment? = null
- rotateWithShape bool = false
public void SetShadow(string color, OfficeLength? blur = null, OfficeLength? distance = null, double angleDegrees = 45, int transparencyPercent = 35, bool rotateWithShape = false) #Parameters
- color string
- blur OfficeLength? = null
- distance OfficeLength? = null
- angleDegrees double = 45
- transparencyPercent int = 35
- rotateWithShape bool = false
public void SetSize(OfficeLength width, OfficeLength height) #Parameters
- width OfficeLength
- height OfficeLength
public void SetSoftEdges(OfficeLength radius) #Parameters
- radius OfficeLength
Properties
public string? ContentType { get; } #Gets the MIME content type of the underlying image.
public string? MimeType { get; } #Gets the MIME content type of the underlying image.
public double CropLeftRatio { get; } #Gets the left crop ratio authored on the picture, where 0 means no crop and 1 means the full width.
public double CropTopRatio { get; } #Gets the top crop ratio authored on the picture, where 0 means no crop and 1 means the full height.
public double CropRightRatio { get; } #Gets the right crop ratio authored on the picture, where 0 means no crop and 1 means the full width.
public double CropBottomRatio { get; } #Gets the bottom crop ratio authored on the picture, where 0 means no crop and 1 means the full height.
public int? LuminanceBrightness { get; set; } #Gets or sets the luminance brightness adjustment as a percentage from -100 through 100, or null when omitted.
public int? LuminanceContrast { get; set; } #Gets or sets the luminance contrast adjustment as a percentage from -100 through 100, or null when omitted.
public bool GrayScale { get; set; } #Gets or sets whether the picture uses grayscale display.
public int? BlackWhiteThreshold { get; set; } #Gets or sets the black-and-white threshold as a percentage from 0 through 100, or null to disable bi-level display. Binary PowerPoint supports the classic value 50.
public OfficeColor? TransparentColor { get; set; } #Gets or sets the RGB color that becomes fully transparent, or null to disable transparent-color replacement.
public OfficeColor? RecolorColor { get; set; } #Gets or sets the RGB color used to recolor the entire picture, or null to disable recoloring.
Inherited Properties
public string? Title { get; set; } #public bool Decorative { get; set; } #public IReadOnlyList<string> Languages { get; } #public string? FillColor { get; set; } #public int? FillTransparency { get; set; } #public double? Rotation { get; set; } #public bool? HorizontalFlip { get; set; } #public bool? VerticalFlip { get; set; } #public PowerPointPlaceholderType? ShapePlaceholderType { get; } #public PowerPointPlaceholderSize? ShapePlaceholderSize { get; } #public PowerPointPlaceholderDirection? ShapePlaceholderOrientation { get; } #public PowerPointShapeContentType ShapeContentType { get; } #public OfficeLength Width { get; set; } #public OfficeLength Height { get; set; } #public OfficeLength Right { get; set; } #public OfficeLength Bottom { get; set; } #public OfficeLength CenterX { get; set; } #public OfficeLength CenterY { get; set; } #public PowerPointLayoutBox Bounds { get; set; } #public string? OutlineColor { get; set; } #public int? OutlineTransparency { get; set; } #public OfficeLength? OutlineWidth { get; set; } #public PowerPointLineDashStyle? OutlineDash { get; set; } #public string? MouseOverSoundName { get; } #