autoit.de/wcf/attachment/6483/Guten Abend zusammen.
War ja jetzt lang nicht mehr anwesend in diesem Forum.
Hab also auch ne Zeitlang nciht mehr mit AutoIt gemacht.
Ein Kumpel hat nun aber gefragt, ob ich ihm schnell so eine
Art große DigitalUhr für den Desktop machen könnte.
Ich natürlich: "Klar, is net so schwer."
So, nun hab ich mal nen Test Script gemacht.
Das Problem ist:
Die Zahlen fangen wie Wild an zu flackern.
Hier mal das Script. Die Bilder mit den Zahlen von 0-9 sind in der Zahlen.rar dabei.
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 871, 221, 191, 137)
GUISetBkColor(0xFFFFFF)
$Pic1 = GUICtrlCreatePic("0.bmp", 0, 0, 130, 220, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic2 = GUICtrlCreatePic("0.bmp", 140, 0, 130, 220, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic3 = GUICtrlCreatePic("0.bmp", 300, 0, 130, 220, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic4 = GUICtrlCreatePic("0.bmp", 440, 0, 130, 220, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic5 = GUICtrlCreatePic("0.bmp", 600, 0, 130, 220, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic6 = GUICtrlCreatePic("0.bmp", 740, 0, 130, 220, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Label1 = GUICtrlCreateLabel(":", 272, 60, 23, 95)
GUICtrlSetFont(-1, 72, 400, 0, "Arial")
$Label2 = GUICtrlCreateLabel(":", 571, 60, 23, 111)
GUICtrlSetFont(-1, 72, 400, 0, "Arial")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
; ===
Local $TimeH = @Hour, $TimeM = @Min, $TimeS = @Sec
; ===
For $H = 0 To 23 Step 1
If $H < 10 Then
If $TimeH = $H Then
GUICtrlSetImage ($Pic1, "0.bmp")
GUICtrlSetImage ($Pic2, $H & ".bmp")
EndIf
Else
$Split1 = StringSplit ($H, "")
GUICtrlSetImage ($Pic1, $Split1[1] & ".bmp")
GUICtrlSetImage ($Pic2, $Split1[2] & ".bmp")
EndIf
Next
; ===
For $M = 00 To 59 Step 1
If $M < 10 Then
If $TimeM = $M Then
GUICtrlSetImage ($Pic3, "0.bmp")
GUICtrlSetImage ($Pic4, $M & ".bmp")
EndIf
Else
$Split2 = StringSplit ($M, "")
GUICtrlSetImage ($Pic3, $Split2[1] & ".bmp")
GUICtrlSetImage ($Pic4, $Split2[2] & ".bmp")
EndIf
Next
; ===
For $S = 00 To 59 Step 1
If $S < 10 Then
If $TimeS = $S Then
GUICtrlSetImage ($Pic5, "0.bmp")
GUICtrlSetImage ($Pic6, $S & ".bmp")
EndIf
Else
$Split3 = StringSplit ($S, "")
GUICtrlSetImage ($Pic5, $Split3[1] & ".bmp")
GUICtrlSetImage ($Pic6, $Split3[2] & ".bmp")
EndIf
Next
WEnd
Das Prog sieht noch etwas mies aus, aber wenn alles klappt, wird die Optik noch besser...