from Bytes
Create and decode an image asset from the given byte array on the provided Rive worker.
The image can only be used on the same RiveWorker it was created on.
Must be registered with ImageAsset.register to be used for referenced images.
⚠️ The lifetime of the returned image is managed by the caller. Make sure to call close when you are done with it to release its resources. The returned image holds a reference to riveWorker, so closing it is required before the worker can fully release memory associated with this image.
Return
The Result of the image decoding, which can be either loading, error, or success with the decoded image asset.
Parameters
rive Worker
The Rive worker that owns the image.
bytes
The byte array containing the image data to decode.