AutoHotkey Community

It is currently May 26th, 2012, 3:36 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Example FreeImage
PostPosted: March 17th, 2009, 9:51 pm 
Offline

Joined: March 17th, 2009, 9:41 pm
Posts: 1
Bonjour,

An example with FreeImage.dll :

Code:
; Exemple   :  Type , largeur et hauteur d'une image
;              AutoHotkey www.autohotkey.com
;              FreeImage  freeimage.sourceforge.net
;
; Functions :  Voir FreeImage.pas et FreeImage3110.pdf

; Variables
   FreeImage_dll = C:\gimp_2_6_5\lib\FreeImage\FreeImage.dll
   image_a_analyser = C:\images_gimp\bebe.jpg

   DLL_open := DllCall( "LoadLibrary" , "Str", FreeImage_dll )     
   ; MsgBox, 0, DLL_open, %DLL_open%
   
   ; FreeImage_Initialise_Function = %FreeImage_dll%\_FreeImage_Initialise@4
   ; FreeImage_Initialise := DllCall(FreeImage_Initialise_Function , "Int", "0")
   ; MsgBox, 0, FreeImage_Initialise, %FreeImage_Initialise%
   
   FreeImage_GetFileType_Function = %FreeImage_dll%\_FreeImage_GetFileType@8
   FreeImage_GetFileType := DllCall(FreeImage_GetFileType_Function , "Str", image_a_analyser , "Int", 0)
   ; MsgBox, 0, FreeImage_GetFileType, %FreeImage_GetFileType%
   
   FreeImage_Load_Function = %FreeImage_dll%\_FreeImage_Load@12
   dib_image := DllCall(FreeImage_Load_Function , "Int", FreeImage_GetFileType, "Str", image_a_analyser, "int", 0)
   
   FreeImage_GetWidth_Function = %FreeImage_dll%\_FreeImage_GetWidth@4
   width := DllCall(FreeImage_GetWidth_Function , "Int", dib_image)
   
   FreeImage_GetHeight_Function = %FreeImage_dll%\_FreeImage_GetHeight@4
   height := DllCall(FreeImage_GetHeight_Function , "Int", dib_image)
   
   DLL_close := DllCall("FreeLibrary", "UInt", DLL_open)
   ; MsgBox, 0, DLL_close, %DLL_close%
   
   MsgBox, 0, %image_a_analyser% : type-width/height , %FreeImage_GetFileType% - %width% / %height% pixels
   


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 21 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group