Image.getImageSize

void getImageSize(out int width, out int height)

Get the width and height in pixels for the specified image. The values of width and height are returned as -1 if the values cannot be obtained (for instance, if the object is not onscreen).

If the size can not be obtained (e.g. missing support), x and y are set to -1.

Parameters

widthfilled with the image width, or -1 if the value cannot be obtained.
heightfilled with the image height, or -1 if the value cannot be obtained.