Table of Contents

Method TryGetEncodedData

Namespace
MaaFramework.Binding.Buffers
Assembly
MaaFramework.Binding.dll

TryGetEncodedData(THandle, out byte[])

Gets the image encoded data from a MaaImageBuffer.

public static abstract bool TryGetEncodedData(THandle handle, out byte[] data)

Parameters

handle THandle

The MaaImageBufferHandle.

data byte[]

The image data (PNG).

Returns

bool

true if the image encoded data was got successfully; otherwise, false.

TryGetEncodedData(THandle, out Stream)

Gets the image encoded data from a MaaImageBuffer.

public static abstract bool TryGetEncodedData(THandle handle, out Stream data)

Parameters

handle THandle

The MaaImageBufferHandle.

data Stream

The image data (PNG).

Returns

bool

true if the image encoded data was got successfully; otherwise, false.

Remarks

Avoids disposing MaaFramework.Binding.Buffers.IMaaImageBuffer before the stream is read.

TryGetEncodedData(THandle, out ReadOnlySpan<byte>)

Gets the image encoded data from a MaaImageBuffer.

public static abstract bool TryGetEncodedData(THandle handle, out ReadOnlySpan<byte> data)

Parameters

handle THandle

The MaaImageBufferHandle.

data ReadOnlySpan<byte>

The image data (PNG).

Returns

bool

true if the image encoded data was got successfully; otherwise, false.

Remarks

Avoids disposing MaaFramework.Binding.Buffers.IMaaImageBuffer before the span is read.

TryGetEncodedData(out byte[], Func<THandle, bool>)

Gets the image encoded data from a function using MaaRectBuffer.

public static abstract bool TryGetEncodedData(out byte[] data, Func<THandle, bool> writeBuffer)

Parameters

data byte[]

The image data (PNG).

writeBuffer Func<THandle, bool>

The function used to write the data to the buffer.

Returns

bool

true if the image encoded data was got successfully; otherwise, false.