#include #include Sleep(5000) ;MsgBox(0,"ScreenCapture","ScreenCapture") Sleep(5000) local $TIF_FILENAME="D:\temp\test.tif" Local $TESS_PARAMS= $TIF_FILENAME & " output" ;Local $TESS_EXE=@ProgramFilesDir & "\Tesseract-OCR\tesseract.exe" Local $TESS_EXE="C:\Program Files (x86)\Tesseract-OCR\tesseract.exe" local $TWorkDir="D:\temp\" Local $iScale = 8.0 ;1.0 is without any scaling SaveTiffImage() sleep(1000) ; Little time for saving the file AnalyzeImage() Func SaveTiffImage() _GDIPlus_Startup() Local Const $iW = @DesktopWidth , $iH = @DesktopHeight Local $hHBmp = _ScreenCapture_Capture("", 0, 0, $iW, 120) ;filename,Left,top,right,bottom//create a GDI bitmap by capturing 1/16 of desktop Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBmp) ;convert GDI bitmap to GDI+ bitmap _WinAPI_DeleteObject($hHBmp) ;release GDI bitmap resource because not needed anymore Local $hBitmap_Scaled = _GDIPlus_ImageScale($hBitmap, $iScale, $iScale, $GDIP_INTERPOLATIONMODE_NEARESTNEIGHBOR) ;scale image by 275% (magnify) ; Save resultant image _GDIPlus_ImageSaveToFile($hBitmap_Scaled, $TIF_FILENAME) ;cleanup resources _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_BitmapDispose($hBitmap_Scaled) _GDIPlus_Shutdown() EndFunc ;==>Example func AnalyzeImage() Local $hTimer = TimerInit() ; Begin the timer and store the handle in a variable. shellexecutewait($TESS_EXE, $TESS_PARAMS, $TWorkDir) Local $fDiff = TimerDiff($hTimer) ; Find the difference in time from the previous call of TimerInit. The variable we stored the TimerInit handlem is passed as the "handle" to TimerDiff. consolewrite( ($fDiff/1000) & "seconds passed") EndFunc