Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PowerPointImage

OfficeIMO.PowerPoint

Namespace
OfficeIMO.PowerPoint
Assembly
OfficeIMO.PowerPoint
Source revision
e163ccb36643 with working tree changes

Represents an image placed on a slide.

Inheritance

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.

Methods

public void Crop(double leftPercent, double topPercent, double rightPercent, double bottomPercent) #

Crops the image by the specified percentages (0-100).

Parameters

leftPercent double required
topPercent double required
rightPercent double required
bottomPercent double required
FitToBox 3 overloads
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 required
Source image width (pixels).
imageHeight double required
Source image height (pixels).
crop bool = true optional
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 required
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 ResetCrop() #

Removes any cropping from the image.

UpdateImage 2 overloads
public void UpdateImage(Stream newImage, OfficeImageFormat type) #

Replaces the picture's underlying image with the provided stream.

Parameters

newImage System.IO.Stream required
Stream containing the new image data.
type OfficeIMO.Drawing.OfficeImageFormat required
Image format of the new image.
public void UpdateImage(string imagePath) #

Replaces the picture's underlying image with the provided file.

Parameters

imagePath string required
Path to the new image file.

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.