Table of Contents

Method TryGetEncodedData

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

TryGetEncodedData(out byte[])

Gets the image encoded data from a MaaImageBuffer.

public bool TryGetEncodedData(out byte[] data)

Parameters

data byte[]

The image data (PNG).

Returns

bool

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

TryGetEncodedData(out Stream)

Gets the image encoded data from a MaaImageBuffer.

public bool TryGetEncodedData(out Stream data)

Parameters

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(out ReadOnlySpan<byte>)

Gets the image encoded data from a MaaImageBuffer.

public bool TryGetEncodedData(out ReadOnlySpan<byte> data)

Parameters

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(nint, out byte[])

Gets the image encoded data from a MaaImageBuffer.

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

Parameters

handle nint

The MaaImageBufferHandle.

data byte[]

The image data (PNG).

Returns

bool

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

TryGetEncodedData(nint, out Stream)

Gets the image encoded data from a MaaImageBuffer.

public static bool TryGetEncodedData(nint handle, out Stream data)

Parameters

handle nint

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(nint, out ReadOnlySpan<byte>)

Gets the image encoded data from a MaaImageBuffer.

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

Parameters

handle nint

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(nint, out nint, out ulong)

Gets the image encoded data from a MaaImageBuffer.

public static bool TryGetEncodedData(nint handle, out nint data, out ulong size)

Parameters

handle nint

The MaaImageBufferHandle.

data nint

The image data (PNG).

size ulong

The encoded size.

Returns

bool

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

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

Gets the image encoded data from a function using MaaRectBuffer.

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

Parameters

data byte[]

The image data (PNG).

writeBuffer Func<nint, bool>

The function used to write the data to the buffer.

Returns

bool

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