ImageExt.OverrideSpriteFromBase64Async Method

Loads a sprite asynchronously from a base64 encoded string and assigns it to the overrideSprite property of an Image.

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

Syntax

C#

public static Task OverrideSpriteFromBase64Async(
	this Image self,
	string base64,
	CancellationToken ct = default
)


Parameters

 

self
Type: Image
Target Image
base64
Type: System.String
Base64 encoded string. See ReadSpriteBase64Async(Image, String, CancellationToken)
ct (Optional)
Type: System.Threading.CancellationToken
Optional cancellation token, to cancel the operation

Return Value

Type: Task
[Missing documentation for “M:UltimateXR.Extensions.Unity.Render.ImageExt.OverrideSpriteFromBase64Async(UnityEngine.UI.Image,System.String,System.Threading.CancellationToken)”]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Image. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

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

ImageExt Class
UltimateXR.Extensions.Unity.Render Namespace