# OfficeImageSourceCrop

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

Struct 

`OfficeIMO.Drawing`

**Namespace**

`OfficeIMO.Drawing`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficeImageSourceCrop.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L14)

**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.

### Returned or exposed by 3

- Property [OfficeImageProjection.SourceCrop](/api/core/officeimo-drawing-officeimageprojection/#property-sourcecrop)
- Method [OfficeImageSourceCrop.FromClampedFractions](/api/core/officeimo-drawing-officeimagesourcecrop/#method-fromclampedfractions-double-double-double-double)
- Method [OfficeImageSourceCrop.FromStrictFractions](/api/core/officeimo-drawing-officeimagesourcecrop/#method-fromstrictfractions-double-double-double-double)

### Accepted by parameters 1

- Constructor [OfficeImageProjection.OfficeImageProjection](/api/core/officeimo-drawing-officeimageprojection/#constructor-ctor-officeimo-drawing-officeimageplacement-officeimo-drawing-officeimagesourcecrop-double-nullable-system-double-nullable-system-double-boolean-boolean) parameter `sourceCrop`

Filter members 

Show inherited

## Constructors

`public OfficeImageSourceCrop(double left, double top, double right, double bottom)` [#](#constructor-ctor-double-double-double-double)

[OfficeImageSourceCrop.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L14)

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)` [#](#method-fromclampedfractions-double-double-double-double)

[OfficeImageSourceCrop.cs:48](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L48)

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**

Returns

`OfficeImageSourceCrop`

`public static OfficeImageSourceCrop FromStrictFractions(double left, double top, double right, double bottom)` [#](#method-fromstrictfractions-double-double-double-double)

[OfficeImageSourceCrop.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L58)

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**

Returns

`OfficeImageSourceCrop`

`public static bool LeavesVisibleSourceArea(double left, double top, double right, double bottom)` [#](#method-leavesvisiblesourcearea-double-double-double-double)

[OfficeImageSourceCrop.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L74)

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()` [#](#method-totuple)

[OfficeImageSourceCrop.cs:84](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L84)

Converts the crop into a tuple.

Returns

`ValueTuple<double, double, double, double>`

## Inherited Methods

`public override bool Equals(object? obj)` [#](#method-equals-object)

Inherited from ValueType

Parameters

**obj object? required**

Returns

`bool`

`public override int GetHashCode()` [#](#method-gethashcode)

Inherited from ValueType

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public override string? ToString()` [#](#method-tostring)

Inherited from ValueType

Returns

`string?`

## Properties

`public double Left { get; }` [#](#property-left)

[OfficeImageSourceCrop.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L21)

Fraction cropped from the left edge of the source image.

`public double Top { get; }` [#](#property-top)

[OfficeImageSourceCrop.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L24)

Fraction cropped from the top edge of the source image.

`public double Right { get; }` [#](#property-right)

[OfficeImageSourceCrop.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L27)

Fraction cropped from the right edge of the source image.

`public double Bottom { get; }` [#](#property-bottom)

[OfficeImageSourceCrop.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L30)

Fraction cropped from the bottom edge of the source image.

`public bool HasCrop { get; }` [#](#property-hascrop)

[OfficeImageSourceCrop.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L33)

Whether any crop edge is greater than zero.

`public bool HasVisibleSourceArea { get; }` [#](#property-hasvisiblesourcearea)

[OfficeImageSourceCrop.cs:36](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L36)

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

`public double VisibleWidth { get; }` [#](#property-visiblewidth)

[OfficeImageSourceCrop.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L39)

Visible width ratio after applying left and right crop fractions.

`public double VisibleHeight { get; }` [#](#property-visibleheight)

[OfficeImageSourceCrop.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L42)

Visible height ratio after applying top and bottom crop fractions.

## Fields

`public const double MinimumVisibleRatio` [#](#field-minimumvisibleratio)

[OfficeImageSourceCrop.cs:8](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageSourceCrop.cs#L8)

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

Value: `0.001`

<!-- PowerForge markdown artifact sha256:F23670A63B34BE355640E144249A9DD7BE0363E2B6C5114CBF01E6ED68FF0C53 -->
