Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Struct

OfficeImageSourceCrop

OfficeIMO.Drawing

Namespace
OfficeIMO.Drawing
Assembly
OfficeIMO.Core
Source revision
ba882f6b0d07 with working tree changes
Base
ValueType
Modifiers
sealed

Describes normalized source-image crop fractions from each image edge.

Inheritance

  • ValueType
  • OfficeImageSourceCrop

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.

Accepted by parameters 1

Constructors

public OfficeImageSourceCrop(double left, double top, double right, double bottom) #

Creates a source-image crop description from normalized edge fractions.

Parameters

left double required
top double required
right double required
bottom double required

Methods

public static OfficeImageSourceCrop FromClampedFractions(double left, double top, double right, double bottom) #

Creates a source crop after clamping each input fraction into the supported normalized range.

Parameters

left double required
top double required
right double required
bottom double required
public static OfficeImageSourceCrop FromStrictFractions(double left, double top, double right, double bottom) #

Creates a source crop from normalized fractions and rejects crops that collapse the visible source area.

Parameters

left double required
top double required
right double required
bottom double required
public static bool LeavesVisibleSourceArea(double left, double top, double right, double bottom) #

Returns whether crop fractions leave a non-empty visible source area.

Parameters

left double required
top double required
right double required
bottom double required

Returns

bool
public ValueTuple<double, double, double, double> ToTuple() #

Converts the crop into a tuple.

Returns

ValueTuple<double, double, double, double>

Properties

public double Left { get; } #

Fraction cropped from the left edge of the source image.

public double Top { get; } #

Fraction cropped from the top edge of the source image.

public double Right { get; } #

Fraction cropped from the right edge of the source image.

public double Bottom { get; } #

Fraction cropped from the bottom edge of the source image.

public bool HasCrop { get; } #

Whether any crop edge is greater than zero.

public bool HasVisibleSourceArea { get; } #

Whether the crop leaves a non-empty source area without requiring fallback clamping.

public double VisibleWidth { get; } #

Visible width ratio after applying left and right crop fractions.

public double VisibleHeight { get; } #

Visible height ratio after applying top and bottom crop fractions.

Fields

public const double MinimumVisibleRatio #

Smallest visible source ratio used when authored crop edges collapse the source area.

Value: 0.001