Returns the unique identifier of the image native resource. Must not be modified.
Encodes the image with given options.
Options used during image encoding.
Encoded image data as a Uint8Array.
Marks this object as retained, meaning that it will not be automatically released when exit from autorelease function occurs.
Saves the image to the given path with given options.
Path to save the image to.
Options used during image saving.
Static fromCreates an image from the given encoded buffer e.g. from jpeg with given options.
Encoded image data as a Uint8Array.
Options used during image loading.
Loaded image reference.
Static fromCreates an image from the given path with given options.
Path to the image file.
Options used during image loading
Loaded image reference.
Static release
Represent an image that is backed by native resources and can be created from various sources.
Example
Since the instance of the class is backed by native resources and implements
AsyncDisposableit's highly recommended to use theawait usingsyntax when an instance is created or is received from an API:Alternatively, one can explicitly call release method to release the native resources or use autorelease convenience function. If neither is used, the resource will be released when the instance is garbage collected which is not recommended.