如此,这样?
#NoTrayIcon
#include <StaticConstants.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#AutoIt3Wrapper_UseX64 = n
HotKeySet('{esc}', '_Exit');退出
$Form1 = GUICreate("Form1", @DesktopWidth, @DesktopHeight)
GUICtrlCreatePic('', 0, 0, @DesktopWidth, @DesktopHeight, BitOR($WS_CLIPSIBLINGS, $SS_NOTIFY))
GUICtrlSetState(-1, 128)
GUISetBkColor(0)
GUISetState(@SW_SHOW)
Global $iTime = 200
_GDIPlus_Startup()
Global $hBrush, $hFormat, $hFamily, $hFont, $tLayout, $hGraphic
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form1)
Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics(@DesktopWidth, @DesktopHeight, $hGraphic)
Global $hBackBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
Global $hImage = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\1.jpg")
_GDIPlus_GraphicsDrawImageRect($hBackBuffer, $hImage, 0, 0, @DesktopWidth, @DesktopHeight)
_GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)
$hBrush = _GDIPlus_BrushCreateSolid(0xFFFF0000)
$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate("Segoe UI")
$hFont = _GDIPlus_FontCreate($hFamily, 40, 1, 2)
$tLayout = _GDIPlus_RectFCreate(@DesktopWidth / 2, @DesktopHeight / 2, 100, 70)
AdlibRegister('_time', 1000)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_Exit()
EndSwitch
WEnd
Func _time()
If $iTime < 0 Then
AdlibUnRegister('_time')
Else
;// 更新数字
$iTime -= 1
ConsoleWrite('$iTime: ' & $iTime & @CRLF)
GUISetState(@SW_DISABLE, $Form1)
_GDIPlus_GraphicsClear($hBackBuffer , 0xFF000000 )
_GDIPlus_GraphicsDrawImageRect($hBackBuffer, $hImage, 0, 0, @DesktopWidth, @DesktopHeight)
_GDIPlus_GraphicsDrawStringEx($hBackBuffer, $iTime, $hFont, $tLayout, $hFormat, $hBrush)
_GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)
EndIf
EndFunc ;==>_time
Func _Exit()
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>_Exit
|