Checking if an image was loaded with LoadAnimImage
BlitzMax Forums/BlitzMax Beginners Area/Checking if an image was loaded with LoadAnimImage
| ||
Is it possible to check if an image was loaded with LoadImage or LoadAnimImage? Or perhaps a way to get the total number of frames an image contains? Thanks. |
| ||
if loadimage(url)=NULL (I think) |
| ||
Yes it is. if image.frames.length > 1 then it is an anim image. |
| ||
Great, cheers. |
| ||
You could just try drawing out all your images as soon you've loaded them. If BMax crashes, assume it didn't work :) > Or perhaps a way to get the total number of > frames an image contains? Um, but you have to declare that when you load an animimage, so surely you must know it already? Or maybe you're doing something more clever than this. |
| ||
Total number of frames is again image.frames.length btw as image.frames is an array of TImageFrame within TImage that holds all image frames of this specific image. |