Skip to content
SiteEmail

cohtml.UserImagesManager

A class that stores and manages preloaded and live view images.

Inherits from cohtml.IPreloadTextureHandable

Name
UserImagesManager(CohtmlUISystem system)
Constructor taking the CohtmlUISystem component which will own the preloaded assets.
voidSubscribePreloadedTextureReleased()
Subscribes to an event that is invoked when a preloaded texture was released by Cohtml.
boolAddLiveView(string name, CohtmlLiveView liveViewComponent)
Adds a CohtmlLiveView component.
voidReleaseLiveViewHandle(IntPtr releasedTexturePtr)
Releases and removes the image handle associated with a specific texture pointer from all active LiveView handlers, stopping it from receiving further image updates.
voidRemoveLiveView(string url)
Removes a CohtmlLiveView component.
voidRemoveLiveViews()
Removes all CohtmlLiveView components.
ResourceResponse.UserImageDataCreateLiveViewImageData(string url)
Creates a native live view image data object for the provided URL.
ResourceResponse.UserImageDataCreateUserImageData(Texture texture, IntPtr texturePtr =default, uint imageHandle =0) =default
Creates a native user image data object for the provided texture.
voidUpdateLiveViews()
Notifies Cohtml that live view resources need to be updated. Should be invoked whenever a change in live view resources occurs.
boolContainsLiveView(string uri)
Returns true if a live view exists with the given resource identifier.
voidAddPreloadedTexture(IntPtr texturePtr, Texture texture)
Adds a preloaded texture to a dictionary collection at the given key.
TextureGetPreloadedTexture(IntPtr texturePtr)
Returns a preloaded texture or null if it doesn’t exist.
boolReleasePreloadedTexture(IntPtr texturePtr)
Releases a preloaded texture from memory.
voidReleaseAllPreloadedTextures()
Releases all preloaded textures from memory.
voidDispose()
Name
Dictionary< IntPtr, Texture >PreloadedTextures
A collection storing preloaded images.
UserImagesManager(
CohtmlUISystem system
)

Constructor taking the CohtmlUISystem component which will own the preloaded assets.

function SubscribePreloadedTextureReleased

Section titled “function SubscribePreloadedTextureReleased”
void SubscribePreloadedTextureReleased()

Subscribes to an event that is invoked when a preloaded texture was released by Cohtml.

bool AddLiveView(
string name,
CohtmlLiveView liveViewComponent
)

Adds a CohtmlLiveView component.

void ReleaseLiveViewHandle(
IntPtr releasedTexturePtr
)

Releases and removes the image handle associated with a specific texture pointer from all active LiveView handlers, stopping it from receiving further image updates.

Parameters:

  • releasedTexturePtr The native texture pointer to identify the LiveView to release.
void RemoveLiveView(
string url
)

Removes a CohtmlLiveView component.

void RemoveLiveViews()

Removes all CohtmlLiveView components.

ResourceResponse.UserImageData CreateLiveViewImageData(
string url
)

Creates a native live view image data object for the provided URL.

ResourceResponse.UserImageData CreateUserImageData(
Texture texture,
IntPtr texturePtr =default,
uint imageHandle =0
) =default

Creates a native user image data object for the provided texture.

void UpdateLiveViews()

Notifies Cohtml that live view resources need to be updated. Should be invoked whenever a change in live view resources occurs.

bool ContainsLiveView(
string uri
)

Returns true if a live view exists with the given resource identifier.

void AddPreloadedTexture(
IntPtr texturePtr,
Texture texture
)

Adds a preloaded texture to a dictionary collection at the given key.

Parameters:

  • texturePtr The pointer that will be used as a key.
  • texture The texture to add.

Reimplements: cohtml.IPreloadTextureHandable.AddPreloadedTexture

Texture GetPreloadedTexture(
IntPtr texturePtr
)

Returns a preloaded texture or null if it doesn’t exist.

Reimplements: cohtml.IPreloadTextureHandable.GetPreloadedTexture

bool ReleasePreloadedTexture(
IntPtr texturePtr
)

Releases a preloaded texture from memory.

Reimplements: cohtml.IPreloadTextureHandable.ReleasePreloadedTexture

void ReleaseAllPreloadedTextures()

Releases all preloaded textures from memory.

void Dispose()
Dictionary< IntPtr, Texture > PreloadedTextures;

A collection storing preloaded images.