Zebra API Doc

zebra.ui.loadImage()

loadImage

(
  • img
  • ready
)
Image

Load an image by the given URL.

Parameters:

  • img String | Image

    an image URL or image object

  • ready Function

    a call back method to be notified when the image has been completely loaded or failed. The method gets three parameters

    • an URL to the image
    • boolean loading result. true means success
    • an image that has been loaded

        // load image
        zebra.ui.loadImage("test.png", function(path, result, image) {
            if (result === false) {
                // handle error
                ...
            }
        });

Return: Image

an image