SpriteExt.ReadSpriteBase64Async Method
Loads asynchronously a sprite encoded in a base64 String.
Namespace: UltimateXR.Extensions.Unity.Render
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public static Task<Sprite> ReadSpriteBase64Async(
Image targetImage,
string base64,
CancellationToken ct = default
)
Parameters
- targetImage
- Type: Image
Image component the sprite will be used for - base64
- Type: System.String
String encoding the file in base64 - ct (Optional)
- Type: System.Threading.CancellationToken
Optional cancellation token, to cancel the operation
Return Value
Type: Task(Sprite)
An awaitable that returns the loaded sprite
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | base64 is null or empty |
OperationCanceledException | Task canceled using ct |
FormatException | The length of base64, ignoring white-space characters, is not zero or a multiple of 4. |
See Also
Reference
SpriteExt Class
UltimateXR.Extensions.Unity.Render Namespace
System.Threading.Tasks.Task