Table of Contents

Class NativeCanvasFrame<TPixel>

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

Canvas frame backed by a NativeSurface.

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

Type Parameters

TPixel

The pixel format.

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

Constructors

NativeCanvasFrame(Rectangle, NativeSurface)

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

public NativeCanvasFrame(Rectangle bounds, NativeSurface surface)

Parameters

bounds Rectangle

The frame bounds.

surface NativeSurface

The native surface 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.