[SOLVED] FreeImage_AcquireMemory problems

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

[SOLVED] FreeImage_AcquireMemory problems

Post by tmplinshi » 01 Oct 2013, 16:46

"_FreeImage_AcquireMemory@12" (ByVal stream As Long, ByRef data As Long, ByRef size_in_bytes As Long) As Long
Below code returns a Buffer Adrress, not a Buffer Data. How can I get the Buffer Data?

Code: Select all

; from http://www.autohotkey.net/~linpinger/bin/lib/FreeImage.ahk
FreeImage_AcquireMemory(hMemory, byref BufAdr, byref BufSize) {
	DataAddr := 0 , DataSizeAddr := 0
	bSucess := DllCall("FreeImage\_FreeImage_AcquireMemory@12" , "int", hMemory, "Uint", &DataAddr, "Uint", &DataSizeAddr)
	BufAdr := numget(DataAddr, 0, "int") , BufSize := numget(DataSizeAddr, 0, "int")
	return, bSucess
}
Test files can be downloaded from here: https://tmplinshi.googlecode.com/svn/tr ... eeimage.7z

Edit: My goal is convert .bmp image to .ppm image, and write to stdout. (Write to file directly using _FreeImage_Save@16 has no problem.)
Last edited by tmplinshi on 07 Oct 2013, 07:43, edited 2 times in total.

Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: FreeImage_AcquireMemory problems

Post by Zelio » 03 Oct 2013, 16:22

What do you try ?
If it work then your data start at address &BufAdr and will over at address &BufAdr+BufSize
Depends what you want, you can use NumGet, or a dllcall("memcpy" , or a function of a lib, ...
Perhaps you have to check the "FreeImage" documentation, your function seems to autodefine an address for your data. Out of my knowledge... also how you define and attribute your hmemory...

Specifying MyVar+0 forces the number in MyVar to be used instead of the address of MyVar itself
NumGet(BufAdr
NumGet(&BufAdr
NumGet(BufAdr+0
NumGet(&BufAdr+0

Perhaps use global too, or that use things as this ?
hData := DllCall("GlobalAlloc", UInt,2, UInt, nSize )
pData := DllCall("GlobalLock", UInt,hData )
DllCall( "RtlMoveMemory", UInt,pData, UInt,&Buffer, UInt,nSize )
DllCall( "GlobalUnlock", UInt,hData )
DllCall( "ole32\CreateStreamOnHGlobal", UInt,hData, Int,True, UIntP,pStream )

tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: FreeImage_AcquireMemory problems

Post by tmplinshi » 04 Oct 2013, 09:20

Thanks for help. I still don't know how to get it. :(

Code: Select all

#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
SetBatchLines -1
ListLines Off

hModule_FreeImage := DllCall("LoadLibrary", "AStr", "FreeImage.dll") 	; Load dll

	hImage := FreeImage_Load("test.bmp")									; Load Image

	hMemory := FreeImage_OpenMemory(0, 0)									; Open Memory
	
		FreeImage_SaveToMemory(7, hImage, hMemory, 0)							; Convert to ppm

		; ------------ Code 1
			; FreeImage_AcquireMemory(hMemory, BufAdr, BufSize)					; Get mem_buffer
				; MsgBox, % BufAdr "`n" BufSize

		; ------------ Code 2
			mem_buffer := size_in_bytes := 0
			_result := DllCall("FreeImage\_FreeImage_AcquireMemory@12" , "int", hMemory, "Uint", &mem_buffer, "Uint", &size_in_bytes)
				MsgBox, % _result   ; TRUE if successful, FALSE otherwise
				MsgBox, % mem_buffer
				FileDelete, mem.ppm
				FileAppend, %mem_buffer%, *mem.ppm

	FreeImage_CloseMemory(hMemory)											; Close Memory

DllCall("FreeLibrary", UInt, hModule_FreeImage)							; Unload dll


; ==========================================================================
; from http://www.autohotkey.net/~linpinger/bin/lib/FreeImage.ahk
FreeImage_Load(ImPath) {
	return, DllCall("FreeImage\_FreeImage_Load@12", "Int", FreeImage_GetFileType(ImPath), "Str", ImPath, "int", 0)
}

FreeImage_OpenMemory(hMemory, size) {
	return, DllCall("FreeImage\_FreeImage_OpenMemory@8" , "int", hMemory, "int", size)
}

FreeImage_SaveToMemory(FIF,hImage, hMemory, Flags) { ; 0:BMP 2:JPG 13:PNG 18:TIF 25:GIF 7:ppm
	return, DllCall("FreeImage\_FreeImage_SaveToMemory@16" , "int", FIF, "int", hImage, "int", hMemory, "int", Flags)
}

FreeImage_AcquireMemory(hMemory, byref BufAdr, byref BufSize) {
   DataAddr := 0 , DataSizeAddr := 0
   bSucess := DllCall("FreeImage\_FreeImage_AcquireMemory@12" , "int", hMemory, "Uint", &DataAddr, "Uint", &DataSizeAddr)
   BufAdr := numget(DataAddr, 0, "int") , BufSize := numget(DataSizeAddr, 0, "int")
   return, bSucess
}

FreeImage_CloseMemory(hMemory) {
	return, DllCall("FreeImage\_FreeImage_CloseMemory@4" , "int", hMemory, "int", size)
}

FreeImage_GetFileType(ImPath) {	; 0:BMP 2:JPG 13:PNG 18:TIF 25:GIF 7:ppm 7:pnm 7:pgm
	return, DllCall("FreeImage\_FreeImage_GetFileType@8" , "Str", ImPath , "Int", 0)
}
; ------------ Code 2
mem_buffer := size_in_bytes := 0
_result := DllCall("FreeImage\_FreeImage_AcquireMemory@12" , "int", hMemory, "Uint", &mem_buffer, "Uint", &size_in_bytes)
MsgBox, % _result ; TRUE if successful, FALSE otherwise
MsgBox, % mem_buffer
FileDelete, mem.ppm
FileAppend, %mem_buffer%, *mem.ppm
The DllCall returns true, but can not write mem_buffer to file.

The c (or c++?) code:

Code: Select all

void testAcquireMemIO(const char *lpszPathName) {
	FIMEMORY *hmem = NULL;
	
	// load a regular file
	FREE_IMAGE_FORMAT fif = FreeImage_GetFileType(lpszPathName);
	FIBITMAP *dib = FreeImage_Load(fif, lpszPathName, 0);
	
	// open and allocate a memory stream
	hmem = FreeImage_OpenMemory();
	
	// save the image to a memory stream
	FreeImage_SaveToMemory(FIF_PNG, dib, hmem, PNG_DEFAULT);
	
	FreeImage_Unload(dib);
	
	// get the buffer from the memory stream
	BYTE *mem_buffer = NULL;
	DWORD size_in_bytes = 0;
	
	FreeImage_AcquireMemory(hmem, &mem_buffer, &size_in_bytes);
	
	// save the buffer to a file stream
	FILE *stream = fopen("buffer.png", "wb");
	if(stream) {
		fwrite(mem_buffer, sizeof(BYTE), size_in_bytes, stream);
		fclose(stream);
	}
	
	// close and free the memory stream
	FreeImage_CloseMemory(hmem);
}
The AutoIt code:

Code: Select all

;	DLL_API BOOL DLL_CALLCONV FreeImage_AcquireMemory(FIMEMORY *stream, BYTE **data, DWORD *size_in_bytes);
Func _FreeImage_AcquireMemory($stream, ByRef $pData, ByRef $size_in_bytes)
	;Author: Prog@ndy
	$pData = 0
	$size_in_bytes = 0
	Local $result = DllCall($__g_hFREEIMAGEDLL, "int", "_FreeImage_AcquireMemory@12", "ptr", $stream, "ptr*", $pData, "dword*", $size_in_bytes);
	If @error Then Return SetError(1, @error, 0)
	$pData = $result[2]
	$size_in_bytes = $result[3]
	Return $result[0]
EndFunc   ;==>_FreeImage_AcquireMemory[

Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: FreeImage_AcquireMemory problems

Post by Zelio » 04 Oct 2013, 10:22

I am not expert sorry but don't try the FileAppend command because you don't say how many bytes you want and AHK don't know too, try a varsetcapacity with memcpy dllcall for manage it, or try a method like this :

Code: Select all

file := FileOpen(Filename, Flags)
file.RawWrite(VarOrAddress, Bytes)
file.Close()

tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: FreeImage_AcquireMemory problems

Post by tmplinshi » 04 Oct 2013, 10:43

I've tried this:

Code: Select all

file := FileOpen("mem.ppm", "w")
file.Write(mem_buffer, size_in_bytes)
file.Close()
The result file is empty.

My goal is convert .bmp image to .ppm image, and write to stdout. (Write to file directly using _FreeImage_Save@16 has no problem.)

Thanks anyway.

Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: FreeImage_AcquireMemory problems

Post by Zelio » 04 Oct 2013, 17:07

I guess in your case it is file.RawWrite(&mem_buffer, size_in_bytes) because it is an address and not a variable to parse, however I don't understand all of your code (haven't time to check your library doc).
What value size_in_bytes give you ? Have you tried a varsetcapacity(mem_buffer, enough_size, 0) before call your dll ?
I hope anybody else will help... I already saw thing with kind of DllCall( "ole32\CreateStreamOnHGlobal", UInt,hData, Int,True, UIntP,pStream), but in your autoit that don't use it, but they define the buffer before call the function.

I tried a little without succes too (in 32bit for discard x64 pointer problem) :(

Code: Select all

#NoEnv
#SingleInstance Force

msgbox % "library:" hModule := DllCall("LoadLibrary", "Str", "FreeImage.dll")
msgbox % "type:" type := DllCall("FreeImage\_FreeImage_GetFileType@8", "AStr", "test.bmp", "Int", 0)
msgbox % "hImage:" hImage := DllCall("FreeImage\_FreeImage_Load@12", "Int", type, "AStr", "test.bmp", "int", 0)
msgbox % "hMemory:" hMemory := DllCall("FreeImage\_FreeImage_OpenMemory@8", "int", 0, "int", 0)
msgbox % "save:" DllCall("FreeImage\_FreeImage_SaveToMemory@16", "int", 0, "int", hImage, "int", hMemory, "int", 0)

mem_buffer := size_in_bytes := 0
;VarSetCapacity(mem_buffer, 64000, 0)
MsgBox, % "return:" DllCall("FreeImage\_FreeImage_AcquireMemory@12" , "uint", hMemory, "uint", &mem_buffer, "uint", &size_in_bytes)
MsgBox, % "size:" NumGet(size_in_bytes)

FileDelete, mem.pnm
file := FileOpen("mem.pnm", "rw")
file.Write(mem_buffer, NumGet(size_in_bytes))
file.Close()

msgbox % "freemem:" DllCall("FreeImage\_FreeImage_CloseMemory@4" , "int", hMemory, "int", 0)
msgbox % "freelib:" DllCall("FreeLibrary", UInt, hModule)
edit: too tired, haven't see the missing "Raw" word...

tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: FreeImage_AcquireMemory problems

Post by tmplinshi » 05 Oct 2013, 02:33

I have the same result too. :( Thank you so much, Zelio! You had spent a lot of time to help me.

I've sent an email to linpinger, hope I can get help from him.

Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: FreeImage_AcquireMemory problems

Post by Zelio » 05 Oct 2013, 04:39

Try this example, it seems to work (File.RawWrite is not same thing than File.Write, Haven't see my error, too tired)

Code: Select all

#NoEnv
#SingleInstance Force

FileDelete, mem.pnm

msgbox % "library:" hModule := DllCall("LoadLibrary", "Str", "FreeImage.dll")
msgbox % "type:" type := DllCall("FreeImage\_FreeImage_GetFileType@8", "AStr", "test.bmp", "Int", 0)
msgbox % "hImage:" hImage := DllCall("FreeImage\_FreeImage_Load@12", "Int", type, "AStr", "test.bmp", "int", 0)
msgbox % "hMemory:" hMemory := DllCall("FreeImage\_FreeImage_OpenMemory@8", "int", 0, "int", 0)
msgbox % "save:" DllCall("FreeImage\_FreeImage_SaveToMemory@16", "int", 0, "int", hImage, "int", hMemory, "int", 0)

mem_buffer := size_in_bytes := 0
; varsetcapacity(mem_buffer, 4, 0), varsetcapacity(size_in_bytes, 4, 0) ; 32bit pointer
MsgBox, % "return:" DllCall("FreeImage\_FreeImage_AcquireMemory@12" , "uint", hMemory, "uint", &mem_buffer, "uint", &size_in_bytes)
MsgBox, % "size:" size := NumGet(size_in_bytes)
MsgBox, % "buffer:" buffer := NumGet(mem_buffer)

file := FileOpen("mem.pnm", "w")
msgbox % "write:" file.RawWrite(buffer+0, size) ; force address
file.Close()

msgbox % "freemem:" DllCall("FreeImage\_FreeImage_CloseMemory@4" , "int", hMemory, "int", 0)
msgbox % "freelib:" DllCall("FreeLibrary", UInt, hModule)
I used a pnm file tag and I checked with a hexadecimal editor (haven't these thing to edit unix picture), each step seems to work, SaveToMemory fail with your tag=7 so check the header (.h or doc) to find tag value.

Else with gdi and a lockbit you can create your own pnm file but that take time and you have to create all specification alone, I already did this for to use with a OCR (but was just a 2 bit depth , black and white), or parse all data with a pure autohotkey solution. Or for example a bin like png2pnm.exe on internet... good luck , do some google search maybe with %whatextIwant%2pnm.exe , some binary can be launched in command and write in in memory with stdin/out, I can't help more sorry...
http://en.wikipedia.org/wiki/Netpbm_format

I don't know what is your goal with pnm file, I found only two old scripts in my personal archive about as ressource (can be intersting for other too, a urbanrivals market bot, and a raw pnm test, that play with pnm value and png layer to discard some problems):

Code: Select all

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

FileDelete, log.txt
FileAppend, % A_Now "`n" , log.txt

Menu, tray, add
Menu, tray, add, log.txt, gotochecklog
menu, tray, Default, log.txt
Menu, Tray, Click, 1

loop
{
Random, rand, 800, 1600
sleep %rand%

FileDelete, A.PNM
FileDelete, B.PNM
FileDelete, C.PNM
FileDelete, D.PNG
FileDelete, E.TXT


;Gui, Add, ActiveX, w980 h640 vWB, Shell.Explorer
;WB.Navigate("URL_LOGIN_cooking")
;Gui, Show

UrlDownloadToFile, http://www.urban-rivals.com/market/?show=0&action=buy&group=all&orderby=asc&sortby=price, data.txt
;UrlDownloadToFile, *0 http://www.urban-rivals.com/market/, data.txt
FileRead, data, data.txt

ID := SubStr(data, p0:=InStr(data, "id_bourse")+11, InStr(data, ",", 0, p0)-p0)

;msgbox % p0 " - " ID

this:="http://dc.ccdn.ur-img.com/price/?id=" ID "&white=0"
UrlDownloadToFile, %this%, D.PNG


RunWait, %comspec% /c png2pnm.exe -n -a A.PNM D.PNG > B.PNM, , Hide

i:=0
Loop, read, A.PNM
  if (a_index=2)
    C:="P1`n" A_LoopReadLine "`n"
  else if (a_index>3)
    Loop, parse, A_LoopReadLine, %A_Space%
      if (a_loopfield<>"") {
        i++
        A%i% := a_loopfield
      }

j:=0
Loop, read, B.PNM
  if a_index>3
    Loop, parse, A_LoopReadLine, %A_Space%
      if (a_loopfield<>"") {
        j++
        B%j% := a_loopfield
      }


if (i=j) {
  loop % i
    C .= ((65535 + B%a_index% - A%a_index%) > 32768) ? 0 : 1
}
else
  loop % i
  {
    j1:=a_index*3-2 , j2:=a_index*3-1 , j3:=a_index*3
    C .= ((65535 + ((B%j1%+B%j2%+B%j3%)/3) - A%a_index%) > 32768) ? 0 : 1
  }

FileAppend, % C, C.PNM

RunWait, %comspec% /c gocr049.exe -m 2 -C 0-9 C.PNM > E.TXT , , Hide

FileRead, E, E.TXT
StringReplace, E, E, `r`n, , All
StringReplace, E, E, %a_space%, , All

if E is integer
{
if (E<121) {
  UrlDownloadToFile, http://www.urban-rivals.com/ajax/market/?action=purchase&id_bourse=%ID%, r.txt
  FileRead, r, r.txt
  FileAppend, % A_Hour ":" A_Min ":" A_Sec " " r " " E "`n", log.txt
  TrayTip, %E%, %r%, 5, 17

error := SubStr(r, InStr(r, ":")+1, 1)
if (error = "-") {
  SoundBeep, 440, 1000
  exitapp
}
}
}
else
{
FileMove, C.PNM, error\%A_Now%.pnm
FileMove, D.PNG, error\%A_Now%.png
FileAppend, % A_Hour ":" A_Min ":" A_Sec " ERROR " E " " A_Now "`n", log.txt
TrayTip, %E%, ERROR %A_Now%, 5, 17
}

}
return

gotochecklog:
Run, log.txt
return

esc::
exitapp

; http://www.urban-rivals.com/ajax/market/?action=cancel_sale&ids_persos_joueur=239550383&ids_bourse=191619660
; http://www.urban-rivals.com/ajax/market/?action=purchase&id_bourse=191631494
; gocr049.exe -m 130 db119.pnm ; set db
; gocr049.exe -m 2 db120.pnm   ; use db

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

;FileRead, data, data.txt
;name:=SubStr(data, p1:=InStr(data, ">", 0, InStr(data, "<div class=""character"">")+23)+1, InStr(data, "<", 0, p1)-p1)
;msgbox % "*" name "*"

FileDelete, result.pgm

i:=0
Loop, read, 1.PGM
  if (a_index=2)
{
StringSplit, param, A_LoopReadLine, %A_Space%
    C:="P5 " param1+1 " " param2 " 255 "
}
  else if (a_index>3)
    Loop, parse, A_LoopReadLine, %A_Space%
      if (a_loopfield<>"") {
        i++
        A%i% := a_loopfield
      }

j:=0
Loop, read, 2.PNM
  if a_index>3
    Loop, parse, A_LoopReadLine, %A_Space%
      if (a_loopfield<>"") {
        j++
        B%j% := a_loopfield
      }


if (i=j) {
  loop % i
{
if (Mod(a_index, param1)=8)
  C .= Chr(255)
    C .= Chr(Floor((65535 + B%a_index% - A%a_index%)/258)+1)
}

}
else
  loop % i
  {
    j1:=a_index*3-2 , j2:=a_index*3-1 , j3:=a_index*3
    C .= Chr(Floor((65535 + ((B%j1%+B%j2%+B%j3%)/3) - A%a_index%)/258)+1)
  }

FileAppend, % C, *result.pgm

tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: FreeImage_AcquireMemory problems

Post by tmplinshi » 05 Oct 2013, 09:46

Yes, the first example works! It seems convert to other formats (bmp, png, tif...) has no problem. The pbm value is correct.

Code: Select all

  FIF_UNKNOWN = -1
  FIF_BMP = 0
  FIF_ICO = 1
  FIF_JPEG = 2
  FIF_JNG = 3
  FIF_KOALA = 4
  FIF_LBM = 5
  FIF_IFF = FIF_LBM
  FIF_MNG = 6
  FIF_PBM = 7
  FIF_PBMRAW = 8
  FIF_PCD = 9
  FIF_PCX = 10
  FIF_PGM = 11
  FIF_PGMRAW = 12
  FIF_PNG = 13
  FIF_PPM = 14
  FIF_PPMRAW = 15
  FIF_RAS = 16
  FIF_TARGA = 17
  FIF_TIFF = 18
  FIF_WBMP = 19
  FIF_PSD = 20
  FIF_CUT = 21
  FIF_XBM = 22
  FIF_XPM = 23
  FIF_DDS = 24
  FIF_GIF = 25
  FIF_HDR = 26
I convert to ppm format for ocr, like you. So 2 colors is ok. Do you still have that ahk script?

Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: FreeImage_AcquireMemory problems

Post by Zelio » 05 Oct 2013, 13:21

No sorry, I all posted already.

A gdi threshold can be found here http://www.autohotkey.com/board/topic/2 ... ic/page-57
you can use lockbit to get each pixel and use http://en.wikipedia.org/wiki/Netpbm_format to know how construct the file

tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: FreeImage_AcquireMemory problems

Post by tmplinshi » 05 Oct 2013, 13:46

Thanks, that's very helpful!

tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: FreeImage_AcquireMemory problems

Post by tmplinshi » 07 Oct 2013, 07:29

Finally, I got it!

Before calling _FreeImage_SaveToMemory@16, we need convert to correct BPP first.
So for example converting to ppm, make sure to call one of below functions before _FreeImage_SaveToMemory@16.

Code: Select all

hImage := DllCall("FreeImage\_FreeImage_ConvertToGreyscale@4" , "int", hImage)    ; Convert to 8 BPP
hImage := DllCall("FreeImage\_FreeImage_ConvertTo8Bits@4" , "int", hImage)        ; Convert to 8 BPP
hImage := DllCall("FreeImage\_FreeImage_ConvertTo24Bits@4" , "int", hImage)       ; Convert to 24 BPP
hImage := DllCall("FreeImage\_FreeImage_Threshold@8" , "int", hImage, "int", 128) ; Convert to 1 BPP, using threshold 128. (Threshold range: 0-255)

Code: Select all

#NoEnv
#SingleInstance Force

FileDelete, mem.pnm

msgbox % "library:" hModule := DllCall("LoadLibrary", "Str", "FreeImage.dll")
msgbox % "type:" type := DllCall("FreeImage\_FreeImage_GetFileType@8", "AStr", "test.bmp", "Int", 0)
msgbox % "hImage:" hImage := DllCall("FreeImage\_FreeImage_Load@12", "Int", type, "AStr", "test.bmp", "int", 0)
msgbox % "hMemory:" hMemory := DllCall("FreeImage\_FreeImage_OpenMemory@8", "int", 0, "int", 0)
msgbox % "BPP (Before):" DllCall("FreeImage\_FreeImage_GetBPP@4" , "int", hImage)
msgbox % "_FreeImage_ConvertTo24Bits@4:" hImage := DllCall("FreeImage\_FreeImage_ConvertTo24Bits@4" , "int", hImage)
msgbox % "BPP (After):" DllCall("FreeImage\_FreeImage_GetBPP@4" , "int", hImage)
msgbox % "save:" DllCall("FreeImage\_FreeImage_SaveToMemory@16", "int", 7, "int", hImage, "int", hMemory, "int", 0)

mem_buffer := size_in_bytes := 0
; varsetcapacity(mem_buffer, 4, 0), varsetcapacity(size_in_bytes, 4, 0) ; 32bit pointer
MsgBox, % "return:" DllCall("FreeImage\_FreeImage_AcquireMemory@12" , "uint", hMemory, "uint", &mem_buffer, "uint", &size_in_bytes)
MsgBox, % "size:" size := NumGet(size_in_bytes)
MsgBox, % "buffer:" buffer := NumGet(mem_buffer)

file := FileOpen("mem.pnm", "w")
msgbox % "write:" file.RawWrite(buffer+0, size) ; force address
file.Close()

msgbox % "freemem:" DllCall("FreeImage\_FreeImage_CloseMemory@4" , "int", hMemory, "int", 0)
msgbox % "freelib:" DllCall("FreeLibrary", UInt, hModule)
Thanks again, Zelio!
Last edited by tmplinshi on 07 Oct 2013, 11:10, edited 1 time in total.

Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: [SOLVED] FreeImage_AcquireMemory problems

Post by Zelio » 07 Oct 2013, 10:05

Congratulation :)
DllCall("FreeImage\_FreeImage_Threshold@8" , "int", hImage, "int", 128) seems a cool function because of background colored, this library seems very good for OCR, if I have time I will check more inside it, thanks you too.

Post Reply

Return to “Ask for Help (v1)”