找回密码
 加入
搜索
查看: 3585|回复: 8

[图形处理] [已解决]有没有显示“答对”和“答错”的小程序?

  [复制链接]
发表于 2013-1-17 15:56:18 | 显示全部楼层 |阅读模式
本帖最后由 黑菜 于 2013-1-18 09:42 编辑

公司年终晚会,需要一个特效:答对的时候投影画面出现个“正确的画面”,同时配有答对的音效,答错反之。

有没有这类的小程序?要按一下快捷键都能全屏跳出来。

或者哪位高手能否帮我现场做一个(音效我已经准备好了)
发表于 2013-1-17 17:25:17 | 显示全部楼层
呵呵~我觉得更适合放到交易区
发表于 2013-1-17 21:25:31 | 显示全部楼层
Global $Paused

HotKeySet('!^w','WinRun')
HotKeySet('!^l','LoseRun')
HotKeySet('{pause}','LinPause')
HotKeySet('{esc}','NowExit')

While 1
        Sleep(100)
WEnd 

Func WinRun()
        ShellExecute('E:\music\北京天使合唱团\北京天使合唱团 - 光阴的故事(广播主打曲).mp3')
        Sleep(500)
        ShellExecute('E:\picture\02.jpg')
EndFunc

Func LoseRun()
        ShellExecute('E:\music\北京天使合唱团\北京天使合唱团 - 茉莉花.mp3')
        Sleep(500)
        ShellExecute('E:\picture\03.jpg')
EndFunc

Func LinPause()
        $Paused = Not $Paused
        While $Paused
                Sleep(100)
                ToolTip('脚本已经"暂停"了',0,0)
        WEnd
        ToolTip("")
EndFunc

Func NowExit()
        Exit 0
EndFunc
发表于 2013-1-17 21:38:24 | 显示全部楼层
Global $Paused

HotKeySet('!^w','WinRun') ;shift-ctrl-w
HotKeySet('!^l','LoseRun') ;shift-ctrl-l
HotKeySet('{pause}','LinPause') ;pause
HotKeySet('{esc}','NowExit') ;esc

While 1
        Sleep(100)
WEnd 

Func WinRun()
        ShellExecute('E:\music\北京天使合唱团\北京天使合唱团 - 光阴的故事(广播主打曲).mp3') ;执行声音文件
        Sleep(1500)
        ShellExecute('E:\picture\02.jpg') ;打开图片
        Sleep(6000)
        WinClose('[class:TTPlayer_PlayerWnd]','') ;关闭千千静听
EndFunc

Func LoseRun()
        ShellExecute('E:\music\北京天使合唱团\北京天使合唱团 - 茉莉花.mp3')
        Sleep(1500)
        ShellExecute('E:\picture\03.jpg')
        Sleep(6000)
        WinClose('[class:TTPlayer_PlayerWnd]','')
EndFunc

Func LinPause()
        $Paused = Not $Paused
        While $Paused
                Sleep(100)
                ToolTip('脚本已经"暂停"了',0,0)
        WEnd
        ToolTip("")
EndFunc

Func NowExit()
        Exit 0
EndFunc
发表于 2013-1-17 22:39:58 | 显示全部楼层
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
Local $YouWin = "恭喜,你答对了"
Local $YouLost = "不好意思,你答错了"
Local $oVoice
$oVoice = ObjCreate("SAPI.SpVoice")
$oVoice.Volume = 100

HotKeySet('!^w', 'WinRun')
HotKeySet('!^l', 'LoseRun')
HotKeySet('{esc}', 'NowExit')

While 1
        Sleep(100)
WEnd

Func WinRun()
        Local $Gui = GUICreate('', 300, 300, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
        GUICtrlCreatePic(@ScriptDir & '\001_18.BMP', 0, 0, 300, 300)
        GUISetState()
        Sleep(1000)
        $oVoice.Speak($YouWin)
        Sleep(5000)
        GUIDelete($Gui)
EndFunc   ;==>WinRun

Func LoseRun()
        Local $Gui = GUICreate('', 300, 300, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
        GUICtrlCreatePic(@ScriptDir & '\001_19.BMP', 0, 0, 300, 300)
        GUISetState()
        Sleep(1000)
        $oVoice.Speak($YouLost)
        Sleep(5000)
        GUIDelete($Gui)
EndFunc   ;==>LoseRun

Func NowExit()
        Exit 0
EndFunc   ;==>NowExit
回复 1# 黑菜
 楼主| 发表于 2013-1-18 07:28:10 | 显示全部楼层
楼上两位帅呆了!非常感谢你们!!
 楼主| 发表于 2013-1-18 09:37:01 | 显示全部楼层
本帖最后由 黑菜 于 2013-1-18 09:41 编辑

做好了,非常棒。感谢
 楼主| 发表于 2013-1-18 10:08:30 | 显示全部楼层
因为我是在全屏播放PPT时需要热键呼出“答对”与“答错”

能否GUI窗口不影响全屏状态?我现在一按热键,任务栏会出现一下,有点不完美。

拜托你们帮忙看看,谢谢!
发表于 2013-1-18 12:57:57 | 显示全部楼层
回复 8# 黑菜
我试了,没有影响了。
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
Local $YouWin = "恭喜,你答对了"
Local $YouLost = "不好意思,你答错了"
Local $oVoice
$oVoice = ObjCreate("SAPI.SpVoice")
$oVoice.Volume = 100
 
HotKeySet('!^w', 'WinRun')
HotKeySet('!^l', 'LoseRun')
HotKeySet('{esc}', 'NowExit')
 
While 1
        Sleep(100)
WEnd
 
Func WinRun()
        SplashImageOn("","c:\1.bmp",300,300,-1,-1,1)
        Sleep(1000)
        $oVoice.Speak($YouWin)
        Sleep(5000)
        SplashOff()
EndFunc   ;==>WinRun
 
Func LoseRun()
        SplashImageOn("","c:\2.bmp",300,300,-1,-1,1)
        Sleep(1000)
        $oVoice.Speak($YouLost)
        Sleep(5000)
        SplashOff()
EndFunc   ;==>LoseRun
 
Func NowExit()
        Exit 0
EndFunc   ;==>NowExit

评分

参与人数 1金钱 +10 收起 理由
黑菜 + 10 非常感谢!

查看全部评分

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

本版积分规则

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

GMT+8, 2024-5-18 06:08 , Processed in 0.082800 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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