找回密码
 加入
搜索
楼主: KLU3K

[图形处理] 【已解决】AU3能做出“鼠标划过水面”的动态效果么?(内详带图)

 火... [复制链接]
发表于 2010-8-16 22:10:05 | 显示全部楼层
高手就出手就是不一样
发表于 2010-8-16 22:27:55 | 显示全部楼层
本帖最后由 rolaka 于 2010-8-16 22:30 编辑
參考4樓改的
Duvet 发表于 2010-8-16 01:37


Local $pic=DllCall("user32.dll","handle","LoadImageW","handle",0,"wstr",@ScriptDir&"\modern-header.bmp","uint",0,"int",0,"int",0,"uint",0x2010)

...原来是这样 我果然傻 没有继续下去...
发表于 2010-8-17 02:43:18 | 显示全部楼层
高手就是处女贴都这么帅~!
afan 发表于 2010-8-16 01:40



    不由再次感叹:只有没想到,没有做不到!AU3确实很棒!
发表于 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



    你已经比我等菜鸟厉害很多了!第一个吃螃蟹的人,同样值得钦佩!
发表于 2010-8-17 04:52:06 | 显示全部楼层
回复 30# Duvet

这个真漂亮!
发表于 2010-8-17 10:38:02 | 显示全部楼层
參考4樓改的
Duvet 发表于 2010-8-16 01:37

你已经比我等菜鸟厉害很多了!第一个吃螃蟹的人,同样值得钦佩!
lynfr8 发表于 2010-8-17 02:44
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[0]
EndFunc   ;==>_WinAPI_LoadImage
死的心都有了...orz... 差在哪儿了呢- -
 楼主| 发表于 2010-8-17 12:42:44 | 显示全部楼层
争取能写个udf,方便调用。
发表于 2010-8-17 13:10:50 | 显示全部楼层
死的心都有了...orz... 差在哪儿了呢- -
rolaka 发表于 2010-8-17 10:38
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 [b]$aResult[0]
EndFunc   ;==>_WinAPI_LoadImage


稍微看了一下,應該是這邊錯了
DllCall($dll,"int","enablewater","HWND",$Form1,"int",0,"int",0,"ptr",[b]$t[0],"int",3,"int",50)
发表于 2010-8-17 13:14:06 | 显示全部楼层
原來源碼不能放顏色代碼啊XP
Return $aResult[0]
DllCall($dll,"int","enablewater","HWND",$Form1,"int",0,"int",0,"ptr",$t[0],"int",3,"int",50)
发表于 2010-8-17 13:23:25 | 显示全部楼层
糊塗了,上面沒錯
應該是沒創建$Form1才對
发表于 2010-8-17 13:36:22 | 显示全部楼层
敬佩Duvet ,请问只能用BMP图片吗?jpg或其他格式图片不能用??
发表于 2010-8-17 13:52:29 | 显示全部楼层
糊塗了,上面沒錯
應該是沒創建$Form1才對
Duvet 发表于 2010-8-17 13:23



    我没给全代码...
发表于 2010-8-17 14:10:31 | 显示全部楼层
期待rolaka 大侠全码,请问只能BMP图片吗?
发表于 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
发表于 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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-19 14:06 , Processed in 0.079624 second(s), 15 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表