Michael Hartlef
13-11-2009, 18:25
Hi folks,
thinBasic doesn't recognize my declares of FreeImage functions at all. What am I doing wrong here?
I always get an error code 30, Variable not defined or misspelled Keyword.
Uses "TBGL" , "UI"
Declare Function FreeImage_GetFileType Lib "FreeImage.dll" Alias "FreeImage_GetFileType" (ByVal fnam As String, ByVal lSize As Long) As Long
Declare Function FreeImage_Load Lib "FreeImage.dll" Alias "FreeImage_Load" (ByVal FREE_IMAGE_FORMAT As Long, ByVal fnam As ASCIIZ) As Long
Declare Function FreeImage_ConvertTo24Bits Lib "FreeImage.dll" Alias "FreeImage_ConvertTo24Bits" (ByVal FIBITMAP As Long) As Long
Declare Function FreeImage_GetWidth Lib "FreeImage.dll" Alias "FreeImage_GetWidth" (ByVal FIBITMAP As Long) As Long
Declare Function FreeImage_GetHeight Lib "FreeImage.dll" Alias "FreeImage_GetHeight" (ByVal FIBITMAP As Long) As Long
Declare Function FreeImage_GetBits Lib "FreeImage.dll" Alias "FreeImage_GetBits" (ByVal FIBITMAP As Long) As Long
Declare Sub FreeImage_Unload Lib "FreeImage.dll" Alias "FreeImage_Unload" (ByVal FIBITMAP As Long)
Dim bitm As Long
Dim fn As String
Dim typ As Long
Dim dirTextures As String = "Textures\"
fn = APP_SourcePath + dirTextures + "fire.jpg"
typ = FreeImage_GetFileType (fn,0)
bitm = FreeImage_Load(typ,fn)
FreeImage_Unload(bitm)
MsgBox(0,"type:"&Str$(typ))
I attached the files too so you can try yourself.
thinBasic doesn't recognize my declares of FreeImage functions at all. What am I doing wrong here?
I always get an error code 30, Variable not defined or misspelled Keyword.
Uses "TBGL" , "UI"
Declare Function FreeImage_GetFileType Lib "FreeImage.dll" Alias "FreeImage_GetFileType" (ByVal fnam As String, ByVal lSize As Long) As Long
Declare Function FreeImage_Load Lib "FreeImage.dll" Alias "FreeImage_Load" (ByVal FREE_IMAGE_FORMAT As Long, ByVal fnam As ASCIIZ) As Long
Declare Function FreeImage_ConvertTo24Bits Lib "FreeImage.dll" Alias "FreeImage_ConvertTo24Bits" (ByVal FIBITMAP As Long) As Long
Declare Function FreeImage_GetWidth Lib "FreeImage.dll" Alias "FreeImage_GetWidth" (ByVal FIBITMAP As Long) As Long
Declare Function FreeImage_GetHeight Lib "FreeImage.dll" Alias "FreeImage_GetHeight" (ByVal FIBITMAP As Long) As Long
Declare Function FreeImage_GetBits Lib "FreeImage.dll" Alias "FreeImage_GetBits" (ByVal FIBITMAP As Long) As Long
Declare Sub FreeImage_Unload Lib "FreeImage.dll" Alias "FreeImage_Unload" (ByVal FIBITMAP As Long)
Dim bitm As Long
Dim fn As String
Dim typ As Long
Dim dirTextures As String = "Textures\"
fn = APP_SourcePath + dirTextures + "fire.jpg"
typ = FreeImage_GetFileType (fn,0)
bitm = FreeImage_Load(typ,fn)
FreeImage_Unload(bitm)
MsgBox(0,"type:"&Str$(typ))
I attached the files too so you can try yourself.