Class: Toybox.Graphics.ResourceReference


Object represents a reference for the resource allocated from the graphics memory pool rather than from the app's local memory. The underlying resource object could be temporarily purged from the system memory pool when all strong references are destroyed. The memory allocation is performed only when ResourceReference::get() method is invoked.


API Level 4.0.0

Direct Known Subclasses

Graphics.BitmapReference, Graphics.BufferedBitmapReference, Graphics.FontReference

Instance Method Summary collapse

Instance Method Details

get() as WatchUi.BitmapResource or Graphics.BufferedBitmap or WatchUi.FontResource or Null

Get the underlying resource object referenced by the ResourceReference, this trigger either the allocate from the system memory pool or return the existing resource in the pool.


  • Lang.Object

    The resource object referenced, or null if failed.


API Level 4.0.0


  • (Lang.OutOfGraphicsMemory)

    Thrown if resource cannot be loaded or restored because there isn't enough free pool to load the resource

Generated Sep 25, 2023 12:31:45 PM