Texture2DExt.FromBase64 Method

Loads asynchronously a texture from a file encoded in a base64 .

Namespace: UltimateXR.Extensions.Unity.Render
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

public static Task<Texture2D> FromBase64(
	string base64,
	CancellationToken ct = default
)


Parameters

 

base64
Type: System.String
The base 64 image string
ct (Optional)
Type: System.Threading.CancellationToken
Optional cancellation token, to cancel the operation

Return Value

Type: Task(Texture2D)
An awaitable Task that returns the loaded texture, or null if it could not be loaded

Exceptions

ExceptionCondition
ArgumentNullExceptionbase64 is null or empty
OperationCanceledExceptionTask canceled using ct
FormatExceptionThe length of base64, ignoring white-space characters, is not zero or a multiple of 4.

See Also

Reference

Texture2DExt Class
UltimateXR.Extensions.Unity.Render Namespace
System.String