Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Struct

OfficeImageProjection

OfficeIMO.Drawing

Namespace
OfficeIMO.Drawing
Assembly
OfficeIMO.Core
Source revision
ba882f6b0d07 with working tree changes
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.

Accepted by parameters 8

Constructors

public OfficeImageProjection(OfficeImagePlacement placement, OfficeImageSourceCrop sourceCrop = default, double rotationDegrees = 0, double? rotationCenterX = null, double? rotationCenterY = null, bool flipHorizontal = false, bool flipVertical = false) #

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() #

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() #

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

public ValueTuple<double, double, double, double> GetDestinationBounds() #

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) #

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() #

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) #

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.

Properties

public OfficeImagePlacement Placement { get; } #

Destination placement rectangle.

public OfficeImageSourceCrop SourceCrop { get; } #

Normalized source crop fractions.

public double RotationDegrees { get; } #

Clockwise rotation in degrees.

public double RotationCenterX { get; } #

Rotation and flip center X coordinate.

public double RotationCenterY { get; } #

Rotation and flip center Y coordinate.

public bool FlipHorizontal { get; } #

Whether to mirror horizontally around the rotation center.

public bool FlipVertical { get; } #

Whether to mirror vertically around the rotation center.

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.

public double SourceLeft { get; } #

Normalized visible source left coordinate.

public double SourceTop { get; } #

Normalized visible source top coordinate.

public double SourceWidth { get; } #

Normalized visible source width.

public double SourceHeight { get; } #

Normalized visible source height.

public bool HasCrop { get; } #

Whether the source image is cropped.

public bool HasRotation { get; } #

Whether the projection applies rotation.

public bool HasTransform { get; } #

Whether the projection applies rotation or flipping.