Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Struct

OfficeTransform

OfficeIMO.Drawing

Namespace
OfficeIMO.Drawing
Assembly
OfficeIMO.Core
Source revision
ba882f6b0d07 with working tree changes
Base
ValueType
Implements
IEquatable<OfficeTransform>
Modifiers
sealed

Dependency-free 2D affine transform in a local top-left coordinate space.

Inheritance

  • ValueType
  • OfficeTransform

Usage

Explore 39 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 22

Constructors

public OfficeTransform(double m11, double m12, double m21, double m22, double offsetX, double offsetY) #

Creates an affine transform.

Parameters

m11 double required
m12 double required
m21 double required
m22 double required
offsetX double required
offsetY double required

Methods

Equals 2 overloads
public bool Equals(OfficeTransform other) #

Indicates whether the current object is equal to another object of the same type.

Parameters

other OfficeIMO.Drawing.OfficeTransform required
An object to compare with this object.

Returns

bool true if the current object is equal to the other parameter; otherwise, false.
public override bool Equals(object? obj) #

Indicates whether this instance and a specified object are equal.

Parameters

obj object? required
The object to compare with the current instance.

Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.
public override int GetHashCode() #

Returns the hash code for this instance.

Returns

int A 32-bit signed integer that is the hash code for this instance.
public OfficeTransform Invert() #

Returns the inverse transform.

Exceptions

  • InvalidOperationException – Thrown when the transform cannot be inverted.
public static bool op_Equality(OfficeTransform left, OfficeTransform right) #

Returns true when two transforms are equal.

Parameters

left OfficeIMO.Drawing.OfficeTransform required
right OfficeIMO.Drawing.OfficeTransform required

Returns

bool
public static bool op_Inequality(OfficeTransform left, OfficeTransform right) #

Returns true when two transforms are not equal.

Parameters

left OfficeIMO.Drawing.OfficeTransform required
right OfficeIMO.Drawing.OfficeTransform required

Returns

bool
RotateDegrees 2 overloads
public static OfficeTransform RotateDegrees(double degrees) #

Creates a clockwise rotation transform around the local origin.

Parameters

degrees double required
public static OfficeTransform RotateDegrees(double degrees, double centerX, double centerY) #

Creates a clockwise rotation transform around a local point.

Parameters

degrees double required
centerX double required
centerY double required
public static OfficeTransform Scale(double scaleX, double scaleY) #

Creates a scale transform around the local origin.

Parameters

scaleX double required
scaleY double required
public OfficeTransform Then(OfficeTransform next) #

Returns a transform that applies this transform first, then the supplied transform.

Parameters

next OfficeIMO.Drawing.OfficeTransform required
public OfficePoint TransformPoint(OfficePoint point) #

Transforms a point in local top-left coordinates.

Parameters

point OfficeIMO.Drawing.OfficePoint required
public ValueTuple<double, double, double, double> TransformRectangleBounds(double x, double y, double width, double height) #

Calculates axis-aligned bounds for a transformed rectangle.

Parameters

x double required
Rectangle left coordinate.
y double required
Rectangle top coordinate.
width double required
Rectangle width.
height double required
Rectangle height.

Returns

ValueTuple<double, double, double, double> Axis-aligned bounds of the transformed rectangle.
public static OfficeTransform Translate(double offsetX, double offsetY) #

Creates a translation transform.

Parameters

offsetX double required
offsetY double required
public bool TryInvert(out OfficeTransform inverse) #

Attempts to create the inverse transform.

Parameters

inverse OfficeIMO.Drawing.OfficeTransform required
Inverse transform when inversion succeeds.

Returns

bool True when the transform has a non-zero determinant.

Properties

public static OfficeTransform Identity { get; } #

Identity transform.

public double M11 { get; } #

Horizontal scale/rotation component.

public double M12 { get; } #

Vertical shear/rotation component.

public double M21 { get; } #

Horizontal shear/rotation component.

public double M22 { get; } #

Vertical scale/rotation component.

public double OffsetX { get; } #

Horizontal translation component.

public double OffsetY { get; } #

Vertical translation component.