# OfficeImageProjection

Describes a projected image render operation shared by raster and SVG renderers.

Struct 

`OfficeIMO.Drawing`

**Namespace**

`OfficeIMO.Drawing`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficeImageProjection.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L25)

**Base**

`ValueType`

**Modifiers**

sealed

Describes a projected image render operation shared by raster and SVG renderers.

## Inheritance

- ValueType
- OfficeImageProjection

## Usage

Explore 11 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 [OfficeDrawingImage.Projection](/api/core/officeimo-drawing-officedrawingimage/#property-projection)
- Method [OfficeImageProjection.Scale](/api/core/officeimo-drawing-officeimageprojection/#method-scale-double)
- Method [OfficeImageProjection.Translate](/api/core/officeimo-drawing-officeimageprojection/#method-translate-double-double)

### Accepted by parameters 8

- Method [OfficeDrawing.AddClippedImage](/api/core/officeimo-drawing-officedrawing/#method-addclippedimage-byte-string-officeimo-drawing-officeimageprojection-double-double-officeimo-drawing-officeclippath-string-double) parameter `projection`
- Method [OfficeDrawing.AddClippedImageWithInterpolation](/api/core/officeimo-drawing-officedrawing/#method-addclippedimagewithinterpolation-byte-string-officeimo-drawing-officeimageprojection-boolean-double-double-officeimo-drawing-officeclippath-string-double) parameter `projection`
- Method [OfficeDrawing.AddImage](/api/core/officeimo-drawing-officedrawing/#method-addimage-byte-string-officeimo-drawing-officeimageprojection-string-double) parameter `projection`
- Method [OfficeDrawing.AddImageBehindContent](/api/core/officeimo-drawing-officedrawing/#method-addimagebehindcontent-byte-string-officeimo-drawing-officeimageprojection-string-double) parameter `projection`
- Method [OfficeDrawing.AddImageWithInterpolation](/api/core/officeimo-drawing-officedrawing/#method-addimagewithinterpolation-byte-string-officeimo-drawing-officeimageprojection-boolean-string-double) parameter `projection`
- Constructor [OfficeDrawingImage.OfficeDrawingImage](/api/core/officeimo-drawing-officedrawingimage/#constructor-ctor-byte-string-officeimo-drawing-officeimageprojection-string-double) parameter `projection`
- Method [OfficeDrawingImage.CreateWithInterpolation](/api/core/officeimo-drawing-officedrawingimage/#method-createwithinterpolation-byte-string-officeimo-drawing-officeimageprojection-boolean-string-double) parameter `projection`
- Method [OfficeRasterCanvas.DrawImage](/api/core/officeimo-drawing-officerastercanvas/#method-drawimage-officeimo-drawing-officerasterimage-officeimo-drawing-officeimageprojection) parameter `projection`

Filter members 

Show inherited

## Constructors

`public OfficeImageProjection(OfficeImagePlacement placement, OfficeImageSourceCrop sourceCrop = default, double rotationDegrees = 0, double? rotationCenterX = null, double? rotationCenterY = null, bool flipHorizontal = false, bool flipVertical = false)` [#](#constructor-ctor-officeimo-drawing-officeimageplacement-officeimo-drawing-officeimagesourcecrop-double-nullable-system-double-nullable-system-double-boolean-boolean)

[OfficeImageProjection.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L25)

Creates an image projection from destination placement, source crop, and transform settings.

Parameters

**placement OfficeIMO.Drawing.OfficeImagePlacement required**

Destination placement rectangle.

**sourceCrop OfficeIMO.Drawing.OfficeImageSourceCrop = default optional**

Normalized source crop fractions.

**rotationDegrees double = 0 optional**

Clockwise rotation in degrees.

**rotationCenterX double? = null optional**

Optional rotation center X coordinate. Defaults to destination center.

**rotationCenterY double? = null optional**

Optional rotation center Y coordinate. Defaults to destination center.

**flipHorizontal bool = false optional**

Whether to mirror horizontally around the rotation center.

**flipVertical bool = false optional**

Whether to mirror vertically around the rotation center.

## Methods

`public OfficeImageFrameTransform CreateFrameTransform()` [#](#method-createframetransform)

[OfficeImageProjection.cs:97](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L97)

Creates a destination-space frame transform for this projection's rotation and mirror settings.

Returns

`OfficeImageFrameTransform` A shared frame transform that can be converted to format-specific transform syntax or matrices.

`public OfficeTransform CreateUnitSquareTransform()` [#](#method-createunitsquaretransform)

[OfficeImageProjection.cs:152](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L152)

Creates an affine transform that maps a unit image rectangle into this projection's destination placement.

Returns

`OfficeTransform`

`public ValueTuple<double, double, double, double> GetDestinationBounds()` [#](#method-getdestinationbounds)

[OfficeImageProjection.cs:161](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L161)

Calculates axis-aligned destination bounds after applying this projection's rotation and mirror settings.

Returns

`ValueTuple<double, double, double, double>` Projected destination bounds.

`public OfficeImageProjection Scale(double scale)` [#](#method-scale-double)

[OfficeImageProjection.cs:110](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L110)

Returns a projection scaled by the supplied output factor.

Parameters

**scale double required**

Positive scale factor.

Returns

`OfficeImageProjection` A scaled projection with source crop and transform flags preserved.

`public ValueTuple<double, double, double, double, double, double, double, ValueTuple<double, double, double, double, bool, bool>> ToTuple()` [#](#method-totuple)

[OfficeImageProjection.cs:167](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L167)

Converts the projection into a tuple useful for assertions and diagnostics.

Returns

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

`public OfficeImageProjection Translate(double offsetX, double offsetY)` [#](#method-translate-double-double)

[OfficeImageProjection.cs:131](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L131)

Returns a projection translated by the supplied destination offset.

Parameters

**offsetX double required**

Horizontal destination offset.

**offsetY double required**

Vertical destination offset.

Returns

`OfficeImageProjection` A translated projection with source crop and transform flags preserved.

## 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 OfficeImagePlacement Placement { get; }` [#](#property-placement)

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

Destination placement rectangle.

`public OfficeImageSourceCrop SourceCrop { get; }` [#](#property-sourcecrop)

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

Normalized source crop fractions.

`public double RotationDegrees { get; }` [#](#property-rotationdegrees)

[OfficeImageProjection.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L45)

Clockwise rotation in degrees.

`public double RotationCenterX { get; }` [#](#property-rotationcenterx)

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

Rotation and flip center X coordinate.

`public double RotationCenterY { get; }` [#](#property-rotationcentery)

[OfficeImageProjection.cs:51](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L51)

Rotation and flip center Y coordinate.

`public bool FlipHorizontal { get; }` [#](#property-fliphorizontal)

[OfficeImageProjection.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L54)

Whether to mirror horizontally around the rotation center.

`public bool FlipVertical { get; }` [#](#property-flipvertical)

[OfficeImageProjection.cs:57](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L57)

Whether to mirror vertically around the rotation center.

`public double X { get; }` [#](#property-x)

[OfficeImageProjection.cs:60](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L60)

Destination left coordinate.

`public double Y { get; }` [#](#property-y)

[OfficeImageProjection.cs:63](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L63)

Destination top coordinate.

`public double Width { get; }` [#](#property-width)

[OfficeImageProjection.cs:66](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L66)

Destination width.

`public double Height { get; }` [#](#property-height)

[OfficeImageProjection.cs:69](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L69)

Destination height.

`public double SourceLeft { get; }` [#](#property-sourceleft)

[OfficeImageProjection.cs:72](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L72)

Normalized visible source left coordinate.

`public double SourceTop { get; }` [#](#property-sourcetop)

[OfficeImageProjection.cs:75](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L75)

Normalized visible source top coordinate.

`public double SourceWidth { get; }` [#](#property-sourcewidth)

[OfficeImageProjection.cs:78](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L78)

Normalized visible source width.

`public double SourceHeight { get; }` [#](#property-sourceheight)

[OfficeImageProjection.cs:81](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L81)

Normalized visible source height.

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

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

Whether the source image is cropped.

`public bool HasRotation { get; }` [#](#property-hasrotation)

[OfficeImageProjection.cs:87](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L87)

Whether the projection applies rotation.

`public bool HasTransform { get; }` [#](#property-hastransform)

[OfficeImageProjection.cs:90](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageProjection.cs#L90)

Whether the projection applies rotation or flipping.

<!-- PowerForge markdown artifact sha256:82E19E939FCCFEE85E943A23B83B7E89AA2731205CC64A927FB20F21E82BD907 -->
