J'ai un petit problème avec ce script qui ne fonctionne pas comme il faut:
Code : Tout sélectionner
#include <GDIPlus.au3>
;Variables
$repetition = 5
$attente = 1 * 1000 * 20
$repertoire = @HOUR & "h" & @MIN & " " & @MDAY & "." & @MON & "." & @YEAR
;Création répertoire
DirCreate($repertoire & "\")
For $i = 001 To $repetition
;Télécharge en arrière plan
Local $hDownload = InetGet("http://toto/map.jpg?0.314970187144354", $repertoire & "\map-" & StringFormat("%03i", $i) & ".jpg", 1, 1)
Do
Sleep(250)
Until InetGetInfo($hDownload, 2)
InetClose($hDownload)
$img1 = $repertoire & "\map-" & StringFormat("%03i", $i) & ".jpg" ; départ
$img2 = $repertoire & "\map-" & StringFormat("%03i", $i) & ".jpg" ; arrivée
_RognerImage($img1, $img2, 5, 24, 991, 938)
FileDelete($img1)
Sleep($attente)
Next
MsgBox(0, "", "Fin du script")
Func _RognerImage($imga, $imgb, $X, $Y, $W, $H)
Local $hImage, $hClone
_GDIPlus_Startup ()
$hImage = _GDIPlus_ImageLoadFromFile ($imga)
$hClone = _GDIPlus_BitmapCloneArea ($hImage, $X, $Y, $W, $H, $GDIP_PXF32RGB)
_GDIPlus_ImageSaveToFile($hClone, $imgb)
_GDIPlus_ImageDispose($hClone)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_ShutDown()
EndFunc
@+


