auto
发表于 2010-8-16 22:10:05
高手就出手就是不一样
rolaka
发表于 2010-8-16 22:27:55
本帖最后由 rolaka 于 2010-8-16 22:30 编辑
參考4樓改的
Duvet 发表于 2010-8-16 01:37 http://www.autoitx.com/images/common/back.gif
Local $pic=DllCall("user32.dll","handle","LoadImageW","handle",0,"wstr",@ScriptDir&"\modern-header.bmp","uint",0,"int",0,"int",0,"uint",0x2010)
...原来是这样 我果然傻 没有继续下去...
lynfr8
发表于 2010-8-17 02:43:18
高手就是处女贴都这么帅~!
afan 发表于 2010-8-16 01:40 http://www.autoitx.com/images/common/back.gif
不由再次感叹:只有没想到,没有做不到!AU3确实很棒!
lynfr8
发表于 2010-8-17 02:44:41
Local $pic=DllCall("user32.dll","handle","LoadImageW","handle",0,"wstr",@ScriptDir&"\modern-head ...
rolaka 发表于 2010-8-16 22:27 http://www.autoitx.com/images/common/back.gif
你已经比我等菜鸟厉害很多了!第一个吃螃蟹的人,同样值得钦佩!
lixiaolong
发表于 2010-8-17 04:52:06
回复 30# Duvet
这个真漂亮!
rolaka
发表于 2010-8-17 10:38:02
參考4樓改的
Duvet 发表于 2010-8-16 01:37 http://www.autoitx.com/images/common/back.gif
你已经比我等菜鸟厉害很多了!第一个吃螃蟹的人,同样值得钦佩!
lynfr8 发表于 2010-8-17 02:44 http://www.autoitx.com/images/common/back.gif
Func _WinAPI_LoadImage($hInstance, $sImage, $iType, $iXDesired, $iYDesired, $iLoad)
Local $aResult, $sImageType = "int"
If IsString($sImage) Then $sImageType = "wstr"
$aResult = DllCall("user32.dll", "handle", "LoadImageW", "handle", $hInstance, $sImageType, $sImage, "uint", $iType, "int", $iXDesired, _
"int", $iYDesired, "uint", $iLoad)
If @error Then Return SetError(@error, @extended, 0)
Return $aResult
EndFunc ;==>_WinAPI_LoadImage
{:face (456):}死的心都有了...orz... 差在哪儿了呢- -
KLU3K
发表于 2010-8-17 12:42:44
争取能写个udf,方便调用。
Duvet
发表于 2010-8-17 13:10:50
死的心都有了...orz... 差在哪儿了呢- -
rolaka 发表于 2010-8-17 10:38 http://www.autoitx.com/images/common/back.gifFunc _WinAPI_LoadImage($hInstance, $sImage, $iType, $iXDesired, $iYDesired, $iLoad)
Local $aResult, $sImageType = "int"
If IsString($sImage) Then $sImageType = "wstr"
$aResult = DllCall("user32.dll", "handle", "LoadImageW", "handle", $hInstance, $sImageType, $sImage, "uint", $iType, "int", $iXDesired, _
"int", $iYDesired, "uint", $iLoad)
If @error Then Return SetError(@error, @extended, 0)
Return $aResult
EndFunc ;==>_WinAPI_LoadImage
稍微看了一下,應該是這邊錯了DllCall($dll,"int","enablewater","HWND",$Form1,"int",0,"int",0,"ptr",$t,"int",3,"int",50)
Duvet
发表于 2010-8-17 13:14:06
原來源碼不能放顏色代碼啊XP
Return $aResult
DllCall($dll,"int","enablewater","HWND",$Form1,"int",0,"int",0,"ptr",$t,"int",3,"int",50)
Duvet
发表于 2010-8-17 13:23:25
糊塗了,上面沒錯{:1_564:}
應該是沒創建$Form1才對
xiaoy
发表于 2010-8-17 13:36:22
敬佩Duvet ,请问只能用BMP图片吗?jpg或其他格式图片不能用??
rolaka
发表于 2010-8-17 13:52:29
糊塗了,上面沒錯
應該是沒創建$Form1才對
Duvet 发表于 2010-8-17 13:23 http://www.autoitx.com/images/common/back.gif
我没给全代码...
xiaoy
发表于 2010-8-17 14:10:31
期待rolaka 大侠全码,请问只能BMP图片吗?
Duvet
发表于 2010-8-17 14:44:54
回复 44# rolaka #include <GUIConstantsEx.au3>
#Include <WinAPI.au3>
$Form1 = GUICreate("",497,54)
$t = _WinAPI_LoadImage(0,@ScriptDir&"\modern-header.bmp",0,0,0,0x2010)
;會不會是你忘了做"DllOpen"的動作? 還是DLL路徑沒給完整名稱?
;註冊在系統上的可直接DllCall("XXX.dll")
$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
sanmoking
发表于 2010-8-17 15:08:12
回复 46# Duvet
我截图下来的bmp,实验失败,大侠帮看看。
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ScreenCapture.au3>
$a = 497
$b = 54
_ScreenCapture_Capture(@TempDir & "\GDIPlus_Image0.bmp",0,0,$a,$b)
_Photo_Flip(@TempDir & "\GDIPlus_Image0.bmp",1,@TempDir & "\GDIPlus_Image1.bmp")
#include <GUIConstantsEx.au3>
#Include <WinAPI.au3>
$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