;_JPG2BMP($jpg,$bmp) 函數取自 顽固不化 改成的
;http://www.autoitx.com/forum.php?mod=redirect&goto=findpost&ptid=11315&pid=115901&fromuid=7653106]
#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>
#Include <WinAPI.au3>
#include <GDIPlus.au3>
Local $a = 497
Local $b = 54
_ScreenCapture_Capture(@TempDir & "\GDIPlus_Image0.bmp",0,0,$a,$b)
_Photo_Flip(@TempDir & "\GDIPlus_Image0.bmp",1,@TempDir & "\GDIPlus_Image1.jpg")
_JPG2BMP(@TempDir & "\GDIPlus_Image1.jpg",@TempDir & "\GDIPlus_Image1.bmp")
$Form1 = GUICreate("",497,54)
$t = _WinAPI_LoadImage(0,@TempDir & "\GDIPlus_Image1.bmp",0,0,0,0x2010)
$d = DllOpen(@ScriptDir&"\waterctrl.dll")
$d = DllCall($d,"int","enablewater","HWND",$Form1,"int",0,"int",0,"ptr",$t,"int",3,"int",50)
GUISetState()
While GUIGetMsg() <> $GUI_EVENT_CLOSE
Sleep(100)
WEnd
Func _Photo_Flip($Path,$Dire,$OutPath)
If Not FileExists($Path) Then Return -1
$Jpeg=_Photo_OpenCalss($Path)
With $Jpeg
If $Dire=1 Then
.FlipV
Else
.FlipH
EndIf
.Save($OutPath)
EndWith
$Jpeg.Close
EndFunc;;;;;;;上下左右翻转 _Photo_Flip("7.jpg","","x.jpg")
Func _Photo_OpenCalss($Path)
If Not FileExists($Path) Then Return -1
$Jpeg = ObjCreate("Persits.Jpeg")
If Not IsObj($Jpeg) Then
FileCopy(@ScriptDir&"\aspjpeg.dll",@SystemDir,1)
RunWait("Regsvr32 /s "& @SystemDir & "\aspjpeg.dll")
RegWrite("HKLM\SOFTWARE\Persits Software\AspJpeg\RegKey","","REG_SZ","48958-77556-02411")
$Jpeg = ObjCreate("Persits.Jpeg")
EndIf
If $Jpeg.Version = "1.9.0.0" Then $Jpeg.PreserveMetadata = True
$Jpeg.Interpolation=2 ;;;图像加强(0-2)
$Jpeg.Quality=100 ;;;;图片质量(0-100)
$Jpeg.Open ($Path)
Return $Jpeg
EndFunc
Func _JPG2BMP($jpg,$bmp)
Local $hImage, $CLSID
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile($jpg)
$CLSID = _GDIPlus_EncodersGetCLSID("BMP")
_GDIPlus_ImageSaveToFileEx($hImage, $bmp, $CLSID)
_GDIPlus_Shutdown()
EndFunc ;==>_JPG2BMP