Table of Contents

Class MemoryCanvasFrame<TPixel>

Namespace
SixLabors.ImageSharp.Drawing.Processing.Backends
Assembly
SixLabors.ImageSharp.Drawing.dll

Canvas frame backed by a Buffer2DRegion<T>.

public sealed class MemoryCanvasFrame<TPixel> : ICanvasFrame<TPixel> where TPixel : unmanaged, IPixel<TPixel>

Type Parameters

TPixel

The pixel format.

Inheritance
MemoryCanvasFrame<TPixel>
Implements
ICanvasFrame<TPixel>
Inherited Members

Constructors

MemoryCanvasFrame(Buffer2DRegion<TPixel>)

Initializes a new instance of the MemoryCanvasFrame<TPixel> class.

public MemoryCanvasFrame(Buffer2DRegion<TPixel> region)

Parameters

region Buffer2DRegion<TPixel>

The pixel buffer region backing this frame.

Properties

Bounds

Gets the frame bounds in root target coordinates.

public Rectangle Bounds { get; }

Property Value

Rectangle

Methods

TryGetCpuRegion(out Buffer2DRegion<TPixel>)

Attempts to get a CPU-accessible destination region.

public bool TryGetCpuRegion(out Buffer2DRegion<TPixel> region)

Parameters

region Buffer2DRegion<TPixel>

The CPU region when available.

Returns

bool

true when a CPU region is available.

TryGetNativeSurface(out NativeSurface?)

Attempts to get an opaque native destination surface.

public bool TryGetNativeSurface(out NativeSurface? surface)

Parameters

surface NativeSurface

The native surface when available.

Returns

bool

true when a native surface is available.