Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OfficeRasterTransforms

OfficeIMO.Drawing

Namespace
OfficeIMO.Drawing
Assembly
OfficeIMO.Core
Source revision
f9d02fda5e27 with working tree changes
Modifiers
static

Reusable geometric edits of managed raster pixels. Every operation returns independent pixels.

Inheritance

  • object
  • OfficeRasterTransforms

Methods

public static OfficeRasterImage AutoOrient(OfficeRasterImage source, int orientation, CancellationToken cancellationToken = default) #

Applies an EXIF orientation value, including mirrored orientations.

Parameters

source OfficeIMO.Drawing.OfficeRasterImage required
orientation int required
cancellationToken System.Threading.CancellationToken = default optional
public static OfficeRasterImage Crop(OfficeRasterImage source, int x, int y, int width, int height, CancellationToken cancellationToken = default) #

Crops an exact in-bounds rectangular pixel region.

Parameters

source OfficeIMO.Drawing.OfficeRasterImage required
x int required
y int required
width int required
height int required
cancellationToken System.Threading.CancellationToken = default optional
public static OfficeRasterImage Flip(OfficeRasterImage source, bool horizontal, bool vertical, CancellationToken cancellationToken = default) #

Mirrors an image horizontally, vertically, or along both axes.

Parameters

source OfficeIMO.Drawing.OfficeRasterImage required
horizontal bool required
vertical bool required
cancellationToken System.Threading.CancellationToken = default optional
public static ValueTuple<int, int> GetRotatedSize(OfficeRasterImage source, double degrees) #

Plans the exact canvas dimensions produced by a clockwise rotation without allocating pixels.

Parameters

source OfficeIMO.Drawing.OfficeRasterImage required
degrees double required

Returns

ValueTuple<int, int>
public static ValueTuple<int, int> GetSkewedSize(OfficeRasterImage source, double degreesX, double degreesY) #

Plans the exact expanded canvas dimensions produced by a skew without allocating pixels.

Parameters

source OfficeIMO.Drawing.OfficeRasterImage required
degreesX double required
degreesY double required

Returns

ValueTuple<int, int>
public static OfficeRasterImage MaskEllipse(OfficeRasterImage source, double x, double y, double width, double height, CancellationToken cancellationToken = default) #

Keeps pixels inside an antialiased ellipse and clears pixels outside it.

Parameters

source OfficeIMO.Drawing.OfficeRasterImage required
x double required
y double required
width double required
height double required
cancellationToken System.Threading.CancellationToken = default optional
public static OfficeRasterImage MaskPolygon(OfficeRasterImage source, IReadOnlyList<OfficePoint> points, CancellationToken cancellationToken = default) #

Keeps pixels inside an antialiased polygon.

Parameters

source OfficeIMO.Drawing.OfficeRasterImage required
points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint> required
cancellationToken System.Threading.CancellationToken = default optional
public static OfficeRasterImage MaskRoundedRectangle(OfficeRasterImage source, double radius, CancellationToken cancellationToken = default) #

Clears pixels outside the rounded corners of the image canvas.

Parameters

source OfficeIMO.Drawing.OfficeRasterImage required
radius double required
cancellationToken System.Threading.CancellationToken = default optional
public static OfficeRasterImage Rotate(OfficeRasterImage source, double degrees, OfficeColor? background = null, CancellationToken cancellationToken = default) #

Rotates clockwise and expands the canvas to retain the entire source.

Parameters

source OfficeIMO.Drawing.OfficeRasterImage required
degrees double required
background OfficeIMO.OfficeColor? = null optional
cancellationToken System.Threading.CancellationToken = default optional
public static OfficeRasterImage Skew(OfficeRasterImage source, double degreesX, double degreesY, OfficeColor? background = null, CancellationToken cancellationToken = default) #

Skews each axis by its angle in degrees and expands the canvas to retain all pixels.

Parameters

source OfficeIMO.Drawing.OfficeRasterImage required
degreesX double required
degreesY double required
background OfficeIMO.OfficeColor? = null optional
cancellationToken System.Threading.CancellationToken = default optional