Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Struct

OfficeImagePlacement

Namespace OfficeIMO.Drawing
Assembly OfficeIMO.Core
Base ValueType
Modifiers sealed

Describes the destination rectangle used when placing an image into a target box.

Inheritance

  • ValueType
  • OfficeImagePlacement

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters

Constructors

public OfficeImagePlacement(Double x, Double y, Double width, Double height) #

Creates a new image placement rectangle.

Parameters

x System.Double requiredposition: 0
y System.Double requiredposition: 1
width System.Double requiredposition: 2
height System.Double requiredposition: 3

Methods

public static Boolean ExceedsAspectRatioDistortion(Double sourceWidth, Double sourceHeight, Double targetWidth, Double targetHeight, Double thresholdRatio) #
Returns: Boolean

Returns whether a source image would visibly distort when stretched into a target rectangle.

Parameters

sourceWidth System.Double requiredposition: 0
Source image width.
sourceHeight System.Double requiredposition: 1
Source image height.
targetWidth System.Double requiredposition: 2
Target rectangle width.
targetHeight System.Double requiredposition: 3
Target rectangle height.
thresholdRatio System.Double requiredposition: 4
Minimum distortion ratio considered visible. Values below 1 are invalid.
public static OfficeImagePlacement Fit(Double sourceWidth, Double sourceHeight, Double targetX, Double targetY, Double targetWidth, Double targetHeight, OfficeImageFit fit = Stretch) #
Returns: OfficeImagePlacement

Fits a source image into a target rectangle using the requested image fit mode.

Parameters

sourceWidth System.Double requiredposition: 0
Source image width.
sourceHeight System.Double requiredposition: 1
Source image height.
targetX System.Double requiredposition: 2
Target rectangle left coordinate.
targetY System.Double requiredposition: 3
Target rectangle top coordinate.
targetWidth System.Double requiredposition: 4
Target rectangle width.
targetHeight System.Double requiredposition: 5
Target rectangle height.
fit OfficeIMO.Drawing.OfficeImageFit = Stretch optionalposition: 6
Image fit mode.

Returns

The destination rectangle to render.

public static Double GetAspectRatioDistortionRatio(Double sourceWidth, Double sourceHeight, Double targetWidth, Double targetHeight) #
Returns: Double

Calculates the visible aspect-ratio change between a source image and a target rectangle.

Parameters

sourceWidth System.Double requiredposition: 0
Source image width.
sourceHeight System.Double requiredposition: 1
Source image height.
targetWidth System.Double requiredposition: 2
Target rectangle width.
targetHeight System.Double requiredposition: 3
Target rectangle height.

Returns

A ratio greater than or equal to 1 where 1 means the source and target aspect ratios match.

public ValueTuple<Double, Double, Double, Double> ToTuple() #
Returns: ValueTuple<Double, Double, Double, Double>

Converts the placement into a tuple.

Properties

public Double X { get; } #

Destination left coordinate.

public Double Y { get; } #

Destination top coordinate.

public Double Width { get; } #

Destination width.

public Double Height { get; } #

Destination height.