freeimage help:)

BlitzPlus Forums/BlitzPlus Programming/freeimage help:)

Nicstt(Posted 2005) [#1]
is there a way of checking if an image exists, before trying to free it?


Nicstt(Posted 2005) [#2]
ok i got round it by creating an image before i free them, just in case.

Does this cause a problem anyone know?


Cold Harbour(Posted 2005) [#3]
You could just go:
If [handle you gave the image]<>0
   freeimage [handle you gave the image]
EndIf



CS_TBL(Posted 2005) [#4]
or shorter:

If handle
blah
Endif

but that's personal style, a valid handle is always>0 .. e.g. 'true'

On a different note, is there a way to check 'what' a handle is?

If a given handle (a function arguement for example) is a correct handle, but a bank, gadget, timer etc. handle, rather than an image handle, and you try to free that with FreeImage.. can't be that good eh ..

/me wants: IsImage(handle), IsBank(handle), IsWindow(handle), IsTimer(handle) etc. etc. Can that be arranged?


Nicstt(Posted 2005) [#5]
thx peeps, hand to use true instead of <>0 but works just fine


Grey Alien(Posted 2005) [#6]
nicoust: have you ever played Dungeon Master, I ask this after seeing your self-classification.