Image DLL FreeImage

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fweil.

Hello,

I am trying to use Freeimage.dll available at http://prdownloads.sourceforge.net/free ... p?download

and I cannot figure out how to use it well.

A small test code like :

Result = OpenLibrary(0, "freeimage.dll")
Debug Result
If Result

Debug "IsFunction FreeImage_Initialise " + Str(IsFunction(0, "FreeImage_Initialise"))
Result = CallFunction(0, "FreeImage_Initialise", #TRUE)
Debug Result

Debug PeekS(CallFunction(0, "FreeImage_GetVersion"))
Debug "IsFunction FreeImage_GetVersion " + Str(IsFunction(0, "FreeImage_GetVersion"))
Result = CallFunction(0, "FreeImage_GetVersion", "")
Debug Result

Result = CallFunction(0, "FreeImage_DeInitialise")
Debug Result

CloseLibrary(0)

EndIf

gives a valid access to the DLL when using OpenLibrairy, but IsFunction return values are always 0 obviously I use names given in the documentation.

Does one have done any tests or have any idea about the issue I have ?

KRgrds



Francois Weil
14, rue Douer
F64100 Bayonne
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

I converted your code to this...

Code: Select all

If OpenLibrary(0, "FreeImage.dll")
 
  FreeImage_Initialise=IsFunction(0,"_FreeImage_Initialise@4")
  FreeImage_GetVersion=IsFunction(0,"_FreeImage_GetVersion@0")
  FreeImage_DeInitialise=IsFunction(0,"_FreeImage_DeInitialise@0")

  Debug CallFunctionFast(FreeImage_Initialise,1)   
  Debug PeekS(CallFunctionFast(FreeImage_GetVersion))
  Debug CallFunctionFast(FreeImage_DeInitialise)
 
  CloseLibrary(0)
EndIf
End

----------
Visit the PB Resources Site at http://www.reelmediaproductions.com/pb
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

AFAIK the FreeImage Project is discontinued. ( http://www.6ixsoft.com/ )


Have a nice day...

Franco
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fweil.

Thnx for this information.

KRgrds

Francois Weil
14, rue Douer
F64100 Bayonne
Post Reply