# OfficeRasterFrames

An ordered snapshot of raster frame references with format-neutral animation timing.

Class 

`OfficeIMO.Drawing`

**Namespace**

`OfficeIMO.Drawing`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`1d5ef38d1e0b` with working tree changes

**Source**

[OfficeRasterFrames.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/1d5ef38d1e0bc45ee35fa9829701a5d52fd16d26/OfficeIMO.Core/Raster/OfficeRasterFrames.cs#L13)

**Implements**

`IReadOnlyList<OfficeRasterFrame>` `IReadOnlyCollection<OfficeRasterFrame>` `IEnumerable<OfficeRasterFrame>` `IEnumerable`

**Modifiers**

sealed

**Attributes**

`DefaultMember("Item")`

An ordered snapshot of raster frame references with format-neutral animation timing.

## Inheritance

- object
- OfficeRasterFrames

## Usage

Explore 5 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

- Method [OfficeRasterFrames.Resize](/api/core/officeimo-drawing-officerasterframes/#method-resize-officeimo-drawing-officerasterresizeoptions-threading-cancellationtoken-int64)
- Method [OfficeRasterFrames.Transform](/api/core/officeimo-drawing-officerasterframes/#method-transform-func-officeimo-drawing-officerasterimage-officeimo-drawing-officerasterimage-func-officeimo-drawing-officerasterimage-system-valuetuple-system-int32-system-int32-threading-cancellationtoken-int64)
- Method [OfficeRasterImageDecoder.DecodeFrames](/api/core/officeimo-drawing-officerasterimagedecoder/#method-decodeframes-byte-officeimo-drawing-officerasterdecodeoptions-int32)

### Accepted by parameters 2

- Method [OfficeRasterImageDecoder.TryDecodeFrames](/api/core/officeimo-drawing-officerasterimagedecoder/#method-trydecodeframes-io-stream-officeimo-drawing-officerasterdecodeoptions-officeimo-drawing-officerasterframes-officeimo-drawing-officerasterdecodeinfo-int32) parameter `frames`
- Method [OfficeRasterImageEncoder.EncodeWithMetadata](/api/core/officeimo-drawing-officerasterimageencoder/#method-encodewithmetadata-officeimo-drawing-officerasterframes-officeimo-drawing-officeimageexportformat-officeimo-drawing-officeimagemetadata-officeimo-drawing-officerasterencodingoptions-int64-threading-cancellationtoken) parameter `frames`

Filter members 

Show inherited

## Constructors

`public OfficeRasterFrames(IEnumerable<OfficeRasterFrame> frames, int playCount = 1)` [#](#constructor-ctor-collections-generic-ienumerable-officeimo-drawing-officerasterframe-int32)

[OfficeRasterFrames.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/1d5ef38d1e0bc45ee35fa9829701a5d52fd16d26/OfficeIMO.Core/Raster/OfficeRasterFrames.cs#L13)

Creates a nonempty frame sequence, retaining the frames and their mutable image buffers.

Parameters

**frames System.Collections.Generic.IEnumerable<OfficeIMO.Drawing.OfficeRasterFrame> required**

One through 4096 frames in display or page order, with at most 50 million aggregate pixels.

**playCount int = 1 optional**

Total animation plays; zero means infinite. Static images and pages use one.

## Methods

`public IEnumerator<OfficeRasterFrame> GetEnumerator()` [#](#method-getenumerator)

[OfficeRasterFrames.cs:87](https://github.com/EvotecIT/OfficeIMO/blob/1d5ef38d1e0bc45ee35fa9829701a5d52fd16d26/OfficeIMO.Core/Raster/OfficeRasterFrames.cs#L87)

Enumerates frames in display or page order.

Returns

`IEnumerator<OfficeRasterFrame>`

Resize 2 overloads

`public OfficeRasterFrames Resize(OfficeRasterResizeOptions options, CancellationToken cancellationToken = default, long additionalRetainedBytes = 0)` [#](#method-resize-officeimo-drawing-officerasterresizeoptions-threading-cancellationtoken-int64)

[OfficeRasterFrames.Resize.cs:8](https://github.com/EvotecIT/OfficeIMO/blob/1d5ef38d1e0bc45ee35fa9829701a5d52fd16d26/OfficeIMO.Core/Raster/OfficeRasterFrames.Resize.cs#L8)

Resizes every frame through shared fit planning, retaining timing and playback count.

Parameters

**options OfficeIMO.Drawing.OfficeRasterResizeOptions required**

**cancellationToken System.Threading.CancellationToken = default optional**

**additionalRetainedBytes long = 0 optional**

Returns

`OfficeRasterFrames`

`public OfficeRasterFrames Resize(int percentage, CancellationToken cancellationToken = default, long additionalRetainedBytes = 0)` [#](#method-resize-int32-threading-cancellationtoken-int64)

[OfficeRasterFrames.Resize.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/1d5ef38d1e0bc45ee35fa9829701a5d52fd16d26/OfficeIMO.Core/Raster/OfficeRasterFrames.Resize.cs#L22)

Resizes each frame by a positive percentage using Bicubic sampling, preserving timing and playback count.

Parameters

**percentage int required**

**cancellationToken System.Threading.CancellationToken = default optional**

**additionalRetainedBytes long = 0 optional**

Returns

`OfficeRasterFrames`

`public OfficeRasterFrames Transform(Func<OfficeRasterImage, OfficeRasterImage> transform, Func<OfficeRasterImage, ValueTuple<int, int>>? outputSize = null, CancellationToken cancellationToken = default, long additionalRetainedBytes = 0)` [#](#member-fd5b0edb1cab6da89cd2a023)

[OfficeRasterFrames.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/1d5ef38d1e0bc45ee35fa9829701a5d52fd16d26/OfficeIMO.Core/Raster/OfficeRasterFrames.cs#L53)

Maps every frame into a new sequence, preserving duration and playback count.

Parameters

**transform System.Func<OfficeIMO.Drawing.OfficeRasterImage, OfficeIMO.Drawing.OfficeRasterImage> required**

Operation returning an image for each source frame.

**outputSize System.Func<OfficeIMO.Drawing.OfficeRasterImage, System.ValueTuple<int, int>>? = null optional**

Result dimensions, evaluated before mapping; omitted for operations that preserve dimensions.

**cancellationToken System.Threading.CancellationToken = default optional**

Observes cancellation during planning and between frames. Callbacks can also observe this token.

**additionalRetainedBytes long = 0 optional**

Nonnegative bytes retained alongside the source and result, such as an auxiliary image used by every callback. Callers account for this storage before mapping begins.

Returns

`OfficeRasterFrames` A complete new sequence. Failure or cancellation does not publish a partial sequence.

## Inherited Methods

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

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

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

Inherited from object

Returns

`int`

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

Inherited from object

Returns

`Type`

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

Inherited from object

Returns

`string?`

## Properties

`public int Count { get; }` [#](#property-count)

[OfficeRasterFrames.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/1d5ef38d1e0bc45ee35fa9829701a5d52fd16d26/OfficeIMO.Core/Raster/OfficeRasterFrames.cs#L31)

Number of frames or pages.

`public OfficeRasterFrame this[int index] { get; }` [#](#property-item-int32)

[OfficeRasterFrames.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/1d5ef38d1e0bc45ee35fa9829701a5d52fd16d26/OfficeIMO.Core/Raster/OfficeRasterFrames.cs#L33)

Frame or page at the requested zero-based index.

Parameters

**index int required**

`public int PlayCount { get; }` [#](#property-playcount)

[OfficeRasterFrames.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/1d5ef38d1e0bc45ee35fa9829701a5d52fd16d26/OfficeIMO.Core/Raster/OfficeRasterFrames.cs#L35)

Total animation plays; zero means infinite.

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