Digitaluhr mit Graphic-Controls (Anzeige flackert)

    • Offizieller Beitrag

    Ich habe die Anzeige der Uhr auf Graphic-Controls umgestellt, allerdings tritt dabei ein seltsames Verhalten auf. Anfangs läuft die Uhr normal, aber so nach ca. 1 Minute fangen die Sekunden an zu flackern. Nach 2 Minuten flackern sie noch häufiger und teilweise flackert die gesamte Anzeige. Ich kann mir nicht erklären, woran das liegt. Die einzelnen Segmente der 7-Segment-Anzeigen werden nur gezeichnet/überschrieben wenn sie gebraucht werden und wie schon gesagt läuft die Anzeige anfangs auch ganz normal.

    Hat jemand eine Erklärung/Abhilfe dafür?

    Hier mal das Script:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <EditConstants.au3>
    #include <StaticConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt('MustDeclareVars', 1)
    Opt('GUIOnEventMode', 1)

    [/autoit] [autoit][/autoit] [autoit]

    Global $gui_digit[6], $dColor = 0xff2222, $eColor = 0x000000, $bgColor = 0xc0c0c0
    Global $s = -1, $m = -1, $h = -1, $ls, $rs

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate('test', 800, 480, -1, -1, $WS_POPUP, BitOr($WS_EX_TOOLWINDOW, $WS_EX_LAYERED))
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, '_MoveWindow')
    GUISetOnEvent($GUI_EVENT_CLOSE,'_End')
    GUISetBKColor($bgColor) ; Hintergrundfarbe setzen

    [/autoit] [autoit][/autoit] [autoit]

    $gui_digit[0] = GUICtrlCreateGraphic(20, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[1] = GUICtrlCreateGraphic(60, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _Colon(103, 20)
    $gui_digit[2] = GUICtrlCreateGraphic(120, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[3] = GUICtrlCreateGraphic(160, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _Colon(203, 20)
    $gui_digit[4] = GUICtrlCreateGraphic(220, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[5] = GUICtrlCreateGraphic(260, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreatePic(@ScriptDir & '\nicht loeschen.gif', 0, 0, 1, 1) ; wird für die Transparenz benötigt (nicht löschen)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    If @HOUR <> $h Then
    $ls = StringLeft(@HOUR, 1)
    $rs = StringRight(@HOUR, 1)
    _DigitShow($gui_digit[0], $ls)
    _DigitShow($gui_digit[1], $rs)
    $h = @HOUR
    EndIf
    If @MIN <> $m Then
    $ls = StringLeft(@MIN, 1)
    $rs = StringRight(@MIN, 1)
    _DigitShow($gui_digit[2], $ls)
    _DigitShow($gui_digit[3], $rs)
    $m = @MIN
    EndIf
    If @SEC <> $s Then
    $ls = StringLeft(@SEC, 1)
    $rs = StringRight(@SEC, 1)
    _DigitShow($gui_digit[4], $ls)
    _DigitShow($gui_digit[5], $rs)
    $s = @SEC
    EndIf
    Sleep(980)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Colon($PosX, $PosY)
    GUICtrlCreateGraphic($PosX, $PosY, 10, 56)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 12, 10, 10)
    GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 36, 10, 10)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _DigitShow($digit, $number)
    Switch $number ; g
    Case 2, 3, 4, 5, 6, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 28)
    Case 0, 1, 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 2, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 30, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 2, 28)
    EndSwitch
    Switch $number ; a
    Case 0, 2, 3, 5, 6, 7, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 0)
    Case 1, 4
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 1, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 31, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 1, 0)
    EndSwitch
    Switch $number ; b
    Case 0, 1, 2, 3, 4, 7, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 28)
    Case 5, 6
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 1)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 23)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 27)
    EndSwitch
    Switch $number ; c
    Case 0, 1, 3, 4, 5, 6, 7, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 56)
    Case 2
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 29)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 55)
    EndSwitch
    Switch $number ; d
    Case 0, 2, 3, 5, 6, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 56)
    Case 1, 4, 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 1, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 31, 56)
    EndSwitch
    Switch $number ; e
    Case 0, 2, 6, 8
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    Case 1, 3, 4, 5, 7, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 29)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 47)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 55)
    EndSwitch
    Switch $number ; f
    Case 0, 4, 5, 6, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 28)
    Case 1, 2, 3, 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 1)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 23)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 27)
    EndSwitch
    Switch $Number
    Case 1
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    Case 4
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    Case 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    EndSwitch
    GUICtrlSetGraphic($digit, $GUI_GR_REFRESH)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _MoveWindow()
    Local $DifX, $DifY, $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    Local $WinPos = WinGetPos(@GUI_WinHandle)
    Local $MPos = MouseGetPos()
    $DifX = $MPos[0] - $WinPos[0]
    $DifY = $MPos[1] - $WinPos[1]
    Do
    Sleep(15)
    $MPos = MouseGetPos()
    $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    Until ($WinPos[0] <> ($MPos[0] - $DifX)) Or ($WinPos[1] <> ($MPos[1] - $DifY)) Or (Not $MouseData[2])
    While $MouseData[2]
    $MPos = MouseGetPos()
    $WinPos = WinGetPos(@GUI_WinHandle)
    If ($WinPos[0] <> ($MPos[0] - $DifX)) Or ($WinPos[1] <> ($MPos[1] - $DifY)) Then
    WinMove(@GUI_WinHandle, '', $MPos[0] - $DifX, $MPos[1] - $DifY)
    EndIf
    Sleep(15)
    $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    WEnd
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _End()
    Exit
    EndFunc

    [/autoit]

    Im ZIP-Achiv (Anhang) befindet sich auch die GIF-Datei.

  • ich hab mal ein bisschen rumgespielt an Deinem Script.

    Hatte das Problem auch schon mal und das nur mit der Zeitdarstellung mit einem Font....

    mein erster Denkansatz war:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <EditConstants.au3>
    #include <StaticConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt('MustDeclareVars', 1)
    Opt('GUIOnEventMode', 1)

    [/autoit] [autoit][/autoit] [autoit]

    Global $gui_digit[6], $dColor = 0xff2222, $eColor = 0x000000, $bgColor = 0xc0c0c0
    Global $s = -1, $m = -1, $h = -1, $ls, $rs, $lm, $rm, $lh, $rh

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate('test', 340, 100, -1, -1, $WS_POPUP);, BitOr($WS_EX_TOOLWINDOW, $WS_EX_LAYERED))
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, '_MoveWindow')
    GUISetOnEvent($GUI_EVENT_CLOSE,'_End')
    GUISetBKColor($bgColor) ; Hintergrundfarbe setzen

    [/autoit] [autoit][/autoit] [autoit]

    $gui_digit[0] = GUICtrlCreateGraphic(20, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[1] = GUICtrlCreateGraphic(60, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _Colon(103, 20)
    $gui_digit[2] = GUICtrlCreateGraphic(120, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[3] = GUICtrlCreateGraphic(160, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _Colon(203, 20)
    $gui_digit[4] = GUICtrlCreateGraphic(220, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[5] = GUICtrlCreateGraphic(260, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreatePic(@ScriptDir & '\nicht loeschen.gif', 0, 0, 1, 1) ; wird für die Transparenz benötigt (nicht löschen)
    time_changed()
    GUISetState()
    AdlibEnable("time_changed",1000)
    While 1
    sleep(1)
    WEnd
    Func time_changed()
    If @HOUR <> $h Then
    $lh = StringLeft(@HOUR, 1)
    $rh = StringRight(@HOUR, 1)
    If $h = -1 Then
    _DigitShow($gui_digit[0], $lh)
    _DigitShow($gui_digit[1], $rh)
    $h = @HOUR
    EndIf
    If $rh > 0 Then
    _DigitShow($gui_digit[0], $lh)
    $h = @HOUR
    Else
    _DigitShow($gui_digit[0], $lh)
    _DigitShow($gui_digit[1], $rh)
    $h = @HOUR
    EndIf
    EndIf
    If @MIN <> $m Then
    $lm = StringLeft(@MIN, 1)
    $rm = StringRight(@MIN, 1)
    If $m = -1 Then
    _DigitShow($gui_digit[2], $lm)
    _DigitShow($gui_digit[3], $rm)
    $m = @MIN
    EndIf
    If $rm > 0 Then
    _DigitShow($gui_digit[2], $lm)
    $m = @MIN
    Else
    _DigitShow($gui_digit[2], $lm)
    _DigitShow($gui_digit[3], $rm)
    $m = @MIN
    EndIf
    EndIf
    If @SEC <> $s Then
    $ls = StringLeft(@SEC, 1)
    $rs = StringRight(@SEC, 1)
    If $s = -1 Then
    _DigitShow($gui_digit[4], $ls)
    _DigitShow($gui_digit[5], $rs)
    $s = @SEC
    EndIf

    If $rs > 0 Then
    _DigitShow($gui_digit[5], $rs)
    $s = @SEC
    Else
    _DigitShow($gui_digit[4], $ls)
    _DigitShow($gui_digit[5], $rs)
    $s = @SEC
    EndIf
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Colon($PosX, $PosY)
    GUICtrlCreateGraphic($PosX, $PosY, 10, 56)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 12, 10, 10)
    GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 36, 10, 10)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _DigitShow($digit, $number)
    Switch $number ; g
    Case 2, 3, 4, 5, 6, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 28)
    Case 0, 1, 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 2, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 30, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 2, 28)
    EndSwitch
    Switch $number ; a
    Case 0, 2, 3, 5, 6, 7, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 0)
    Case 1, 4
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 1, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 31, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 1, 0)
    EndSwitch
    Switch $number ; b
    Case 0, 1, 2, 3, 4, 7, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 28)
    Case 5, 6
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 1)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 23)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 27)
    EndSwitch
    Switch $number ; c
    Case 0, 1, 3, 4, 5, 6, 7, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 56)
    Case 2
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 29)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 55)
    EndSwitch
    Switch $number ; d
    Case 0, 2, 3, 5, 6, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 56)
    Case 1, 4, 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 1, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 31, 56)
    EndSwitch
    Switch $number ; e
    Case 0, 2, 6, 8
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    Case 1, 3, 4, 5, 7, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 29)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 47)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 55)
    EndSwitch
    Switch $number ; f
    Case 0, 4, 5, 6, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 28)
    Case 1, 2, 3, 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 1)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 23)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 27)
    EndSwitch
    Switch $Number
    Case 1
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    Case 4
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    Case 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    EndSwitch
    GUICtrlSetGraphic($digit, $GUI_GR_REFRESH)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _MoveWindow()
    Local $DifX, $DifY, $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    Local $WinPos = WinGetPos(@GUI_WinHandle)
    Local $MPos = MouseGetPos()
    $DifX = $MPos[0] - $WinPos[0]
    $DifY = $MPos[1] - $WinPos[1]
    Do
    Sleep(15)
    $MPos = MouseGetPos()
    $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    Until ($WinPos[0] <> ($MPos[0] - $DifX)) Or ($WinPos[1] <> ($MPos[1] - $DifY)) Or (Not $MouseData[2])
    While $MouseData[2]
    $MPos = MouseGetPos()
    $WinPos = WinGetPos(@GUI_WinHandle)
    If ($WinPos[0] <> ($MPos[0] - $DifX)) Or ($WinPos[1] <> ($MPos[1] - $DifY)) Then
    WinMove(@GUI_WinHandle, '', $MPos[0] - $DifX, $MPos[1] - $DifY)
    EndIf
    Sleep(15)
    $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    WEnd
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _End()
    Exit
    EndFunc

    [/autoit]


    Hat mir aber nicht wirklich weiter geholfen.

    Ich glaube, dass das flackern "Interferenzen" sind, die beim Errechnen des zu "zeichnenden" Objektes entstehen.
    Außerdem faßt Du mit Deiner Routine bei jedem Lauf (1x pro Sek.) alle Zahlen an

    Mein Vorschlag wäre, alle Zahlen als "8" initial zu zeichnen und dann nur noch mit einem zweiten Satz initial gezeichneter Segmente in bgcolor
    die notwendigen Segmente über GuiSetState auf Show/Hide zu setzen.
    Dabei mit einer Routine überprüfen, wieviele und welche Zahlen sich geändert haben...
    Ich denke dann wäre das flackern auch vorbei...

    MfG Schnuffel

    "Sarkasmus ist die niedrigste Form des Witzes, aber die höchste Form der Intelligenz."
    Val McDermid

    ein paar Infos ...

    Wer mehr als "nur" Hilfe benötigt, kann sich gern im Forum "Programmieranfragen" an uns wenden. Wir helfen in allen Fällen, die die Forenregeln zulassen.

    Für schnelle Hilfe benötigen wir ein ! lauffähiges ! Script, dass wir als Demonstration des Problems testen können. Wer von uns erwartet ein Teilscript erstmal lauffähig zu bekommen, der hat
    1. keine wirkliche Not
    2. keinen Respekt vor Menschen die ihm in ihrer Freizeit Ihre Hilfe anbieten
    3. oder ist einfach nur faul und meint wir coden das für ihn

    In solchen Fällen erlaube ich mir, die Anfrage einfach zu ignorieren. ;)

    • Offizieller Beitrag

    Mein vorheriger Ansatz war ein aktualisieren über SHOW/HIDE, aber das funktioniert bei Graphic-Controls nicht. Die lassen sich mit GUICtrlSetState($Control-ID, $GUI_HIDE) nicht verstecken.

    Deswegen ja, das "übermalen" mit der Hintergrund-(Transparent-)Farbe. Und mein Script übermalt ja auch nicht alles, sondern nur die Segmente, die nicht verwendet werden.

    Eigenartig ist ja gerade, dass es ca. 1 Minute ganz normal läuft. :S

  • sorry, hab ich nicht ganz zu Ende gedacht :huh:

    Vielleicht hilft Dir ja mein Ansatz ein Stück weiter.
    Ich vertrau der "sleep" Geschichte nicht so ganz ;)

    MfG Schnuffel

    "Sarkasmus ist die niedrigste Form des Witzes, aber die höchste Form der Intelligenz."
    Val McDermid

    ein paar Infos ...

    Wer mehr als "nur" Hilfe benötigt, kann sich gern im Forum "Programmieranfragen" an uns wenden. Wir helfen in allen Fällen, die die Forenregeln zulassen.

    Für schnelle Hilfe benötigen wir ein ! lauffähiges ! Script, dass wir als Demonstration des Problems testen können. Wer von uns erwartet ein Teilscript erstmal lauffähig zu bekommen, der hat
    1. keine wirkliche Not
    2. keinen Respekt vor Menschen die ihm in ihrer Freizeit Ihre Hilfe anbieten
    3. oder ist einfach nur faul und meint wir coden das für ihn

    In solchen Fällen erlaube ich mir, die Anfrage einfach zu ignorieren. ;)

  • Oscar, versuch mal meinen Ansatz, CPU-Last 0-2%

    MfG Schnuffel

    "Sarkasmus ist die niedrigste Form des Witzes, aber die höchste Form der Intelligenz."
    Val McDermid

    ein paar Infos ...

    Wer mehr als "nur" Hilfe benötigt, kann sich gern im Forum "Programmieranfragen" an uns wenden. Wir helfen in allen Fällen, die die Forenregeln zulassen.

    Für schnelle Hilfe benötigen wir ein ! lauffähiges ! Script, dass wir als Demonstration des Problems testen können. Wer von uns erwartet ein Teilscript erstmal lauffähig zu bekommen, der hat
    1. keine wirkliche Not
    2. keinen Respekt vor Menschen die ihm in ihrer Freizeit Ihre Hilfe anbieten
    3. oder ist einfach nur faul und meint wir coden das für ihn

    In solchen Fällen erlaube ich mir, die Anfrage einfach zu ignorieren. ;)

    • Offizieller Beitrag

    Ich habe Dein Script schon getestet, leider ändert das nichts am Ergebnis.
    Es ist auch nicht die CPU-Last, die mir Sorgen bereitet, sondern das die Speicherauslastung ansteigt.

    Ich habe mein Script mal dahingehend verändert, dass jede Minute die Controls gelöscht und neu erstellt werden. Das hat zur Folge, dass die Speicherauslastung konstant bleibt.

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <EditConstants.au3>
    #include <StaticConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt('MustDeclareVars', 1)
    Opt('GUIOnEventMode', 1)

    [/autoit] [autoit][/autoit] [autoit]

    Global $gui_digit[6], $dColor = 0xff2222, $eColor = 0x000000, $bgColor = 0xc0c0c0
    Global $s = -1, $m = -1, $h = -1, $hh, $hm, $hs, $ls, $rs

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate('test', 800, 480, -1, -1, $WS_POPUP, BitOr($WS_EX_TOOLWINDOW, $WS_EX_LAYERED))
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, '_MoveWindow')
    GUISetOnEvent($GUI_EVENT_CLOSE,'_End')
    GUISetBKColor($bgColor) ; Hintergrundfarbe setzen

    [/autoit] [autoit][/autoit] [autoit]

    $gui_digit[0] = GUICtrlCreateGraphic(20, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[1] = GUICtrlCreateGraphic(60, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _Colon(103, 20)
    $gui_digit[2] = GUICtrlCreateGraphic(120, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[3] = GUICtrlCreateGraphic(160, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _Colon(203, 20)
    $gui_digit[4] = GUICtrlCreateGraphic(220, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[5] = GUICtrlCreateGraphic(260, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreatePic(@ScriptDir & '\nicht loeschen.gif', 0, 0, 1, 1) ; wird für die Transparenz benötigt (nicht löschen)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $hm = @MIN
    If $hm <> $m Then
    For $i = 0 To 5
    GUICtrlDelete($gui_digit[$i])
    Next
    $gui_digit[0] = GUICtrlCreateGraphic(20, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[1] = GUICtrlCreateGraphic(60, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[2] = GUICtrlCreateGraphic(120, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[3] = GUICtrlCreateGraphic(160, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[4] = GUICtrlCreateGraphic(220, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[5] = GUICtrlCreateGraphic(260, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $ls = StringLeft($hm, 1)
    $rs = StringRight($hm, 1)
    _DigitShow($gui_digit[2], $ls)
    _DigitShow($gui_digit[3], $rs)
    $m = $hm
    $h = -1
    EndIf
    $hh = @HOUR
    If $hh <> $h Then
    $ls = StringLeft($hh, 1)
    $rs = StringRight($hh, 1)
    _DigitShow($gui_digit[0], $ls)
    _DigitShow($gui_digit[1], $rs)
    $h = $hh
    EndIf
    $hs = @SEC
    If $hs <> $s Then
    $ls = StringLeft($hs, 1)
    $rs = StringRight($hs, 1)
    _DigitShow($gui_digit[4], $ls)
    _DigitShow($gui_digit[5], $rs)
    $s = $hs
    EndIf
    Sleep(10)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Colon($PosX, $PosY)
    GUICtrlCreateGraphic($PosX, $PosY, 10, 56)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 12, 10, 10)
    GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 36, 10, 10)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _DigitShow($digit, $number)
    Switch $number ; g
    Case 2, 3, 4, 5, 6, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 28)
    Case 0, 1, 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 2, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 30, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 2, 28)
    EndSwitch
    Switch $number ; a
    Case 0, 2, 3, 5, 6, 7, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 0)
    Case 1, 4
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 1, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 31, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 1, 0)
    EndSwitch
    Switch $number ; b
    Case 0, 1, 2, 3, 4, 7, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 28)
    Case 5, 6
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 1)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 23)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 27)
    EndSwitch
    Switch $number ; c
    Case 0, 1, 3, 4, 5, 6, 7, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 56)
    Case 2
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 29)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 55)
    EndSwitch
    Switch $number ; d
    Case 0, 2, 3, 5, 6, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 56)
    Case 1, 4, 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 1, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 31, 56)
    EndSwitch
    Switch $number ; e
    Case 0, 2, 6, 8
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    Case 1, 3, 4, 5, 7, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 29)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 47)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 55)
    EndSwitch
    Switch $number ; f
    Case 0, 4, 5, 6, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 28)
    Case 1, 2, 3, 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 1)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 23)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 27)
    EndSwitch
    Switch $Number
    Case 1
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    Case 4
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    Case 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    EndSwitch
    GUICtrlSetGraphic($digit, $GUI_GR_REFRESH)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _MoveWindow()
    Local $DifX, $DifY, $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    Local $WinPos = WinGetPos(@GUI_WinHandle)
    Local $MPos = MouseGetPos()
    $DifX = $MPos[0] - $WinPos[0]
    $DifY = $MPos[1] - $WinPos[1]
    Do
    Sleep(15)
    $MPos = MouseGetPos()
    $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    Until ($WinPos[0] <> ($MPos[0] - $DifX)) Or ($WinPos[1] <> ($MPos[1] - $DifY)) Or (Not $MouseData[2])
    While $MouseData[2]
    $MPos = MouseGetPos()
    $WinPos = WinGetPos(@GUI_WinHandle)
    If ($WinPos[0] <> ($MPos[0] - $DifX)) Or ($WinPos[1] <> ($MPos[1] - $DifY)) Then
    WinMove(@GUI_WinHandle, '', $MPos[0] - $DifX, $MPos[1] - $DifY)
    EndIf
    Sleep(15)
    $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    WEnd
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _End()
    Exit
    EndFunc

    [/autoit]

    Es muss also mit den GUICtrlSetGraphic zu tun haben. Scheinbar wird mit jedem Befehl ein neues Object oder so erzeugt, was den Speicherbedarf nach oben treibt und ab einer bestimmten Anzahl dazu führt, dass das Ganze flackert.
    Hmmm...alles sehr unbefriedigend...

  • schade...
    das engl. Forum gibt auch nicht's befriedigendes her:
    http://www.autoitscript.com/forum/index.php?showtopic=70430&hl=guictrlsetgraphic
    müsstest für jede Ziffer an jeder Stelle eine child-Gui basteln. ( 60Stk.) Diese könntest Du dann hiden :thumbdown:

    Jetzt gehen mir dann so langsam auch die Ideen aus...
    Bleiben wohl doch nur deine gif's :rolleyes:

    Da fäält mir noch was ein.....
    Wie wäre es, wenn Du vor jedem neuzeichnen einer Zahl für diese GuiCtrlDelete ausführst. Dann kann der Speicher nicht in die Höhe.

    MfG Schnuffel

    "Sarkasmus ist die niedrigste Form des Witzes, aber die höchste Form der Intelligenz."
    Val McDermid

    ein paar Infos ...

    Wer mehr als "nur" Hilfe benötigt, kann sich gern im Forum "Programmieranfragen" an uns wenden. Wir helfen in allen Fällen, die die Forenregeln zulassen.

    Für schnelle Hilfe benötigen wir ein ! lauffähiges ! Script, dass wir als Demonstration des Problems testen können. Wer von uns erwartet ein Teilscript erstmal lauffähig zu bekommen, der hat
    1. keine wirkliche Not
    2. keinen Respekt vor Menschen die ihm in ihrer Freizeit Ihre Hilfe anbieten
    3. oder ist einfach nur faul und meint wir coden das für ihn

    In solchen Fällen erlaube ich mir, die Anfrage einfach zu ignorieren. ;)

    • Offizieller Beitrag


    Da fäält mir noch was ein.....
    Wie wäre es, wenn Du vor jedem neuzeichnen einer Zahl für diese GuiCtrlDelete ausführst. Dann kann der Speicher nicht in die Höhe.

    Das hatte ich ganz zuerst. Und Nein, das willst Du nicht wirklich sehen. Das flackert wie irre.

    Ich danke Dir aber trotzdem für's testen und Ideen beisteuern. :thumbup:

  • ich denke der Bug liegt im GuiCtrlCreateGraphic.

    Ich hab mich nochmal versucht, aber trotz Aufwand ist das Ergebnis nicht 100%.
    Ich hab sowas mal mit Javascript gemacht, dass war weniger Code und sah gleich gut aus (ohne flackern...)

    Na ja, wir haben es versucht.

    Kannst ja mal schauen, was ich verändert habe. Vielleicht reicht Dir ja das Ergebnis 8)

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <EditConstants.au3>
    #include <StaticConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt('MustDeclareVars', 1)
    Opt('GUIOnEventMode', 1)

    [/autoit] [autoit][/autoit] [autoit]

    Global $gui_digit[6], $dColor = 0xff2222, $eColor = 0x000000, $bgColor = 0xdddddd;0xc0c0c0
    Global $s = -1, $m = -1, $h = -1, $lh, $rh, $lm, $rm, $ls, $rs, $my_s

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate('test', 340, 100, -1, -1, $WS_POPUP);, BitOr($WS_EX_TOOLWINDOW, $WS_EX_LAYERED))
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, '_MoveWindow')
    GUISetOnEvent($GUI_EVENT_CLOSE,'_End')
    GUISetBKColor($bgColor) ; Hintergrundfarbe setzen

    [/autoit] [autoit][/autoit] [autoit]

    $gui_digit[0] = GUICtrlCreateGraphic(20, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    GuiCtrlSetState(-1,$GUI_DISABLE)
    $gui_digit[1] = GUICtrlCreateGraphic(60, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    GuiCtrlSetState(-1,$GUI_DISABLE)
    _Colon(103, 20)
    $gui_digit[2] = GUICtrlCreateGraphic(120, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    GuiCtrlSetState(-1,$GUI_DISABLE)
    $gui_digit[3] = GUICtrlCreateGraphic(160, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    GuiCtrlSetState(-1,$GUI_DISABLE)
    _Colon(203, 20)
    $gui_digit[4] = GUICtrlCreateGraphic(220, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    GuiCtrlSetState(-1,$GUI_DISABLE)
    $gui_digit[5] = GUICtrlCreateGraphic(260, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    GuiCtrlSetState(-1,$GUI_DISABLE)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    _TimeChanged()
    GUICtrlCreatePic(@ScriptDir & '\nicht loeschen.gif', 0, 0, 1, 1) ; wird für die Transparenz benötigt (nicht löschen)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    If @SEC <> $my_s Then
    $my_s = @SEC
    _TimeChanged()
    EndIf
    sleep(1)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _TimeChanged()
    $lh = StringLeft(@HOUR, 1)
    $rh = StringRight(@HOUR, 1)
    If $h = -1 Or $lh <> StringLeft($h, 1) Then
    GuiCtrlDelete($gui_digit[0])
    sleep(1)
    $gui_digit[0] = GUICtrlCreateGraphic(20, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _DigitShow($gui_digit[0], $lh)
    GuiCtrlDelete($gui_digit[1])
    sleep(1)
    $gui_digit[1] = GUICtrlCreateGraphic(60, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _DigitShow($gui_digit[1], $rh)
    $h = @HOUR
    ElseIf $h <> @HOUR Then
    GuiCtrlDelete($gui_digit[1])
    sleep(1)
    $gui_digit[1] = GUICtrlCreateGraphic(60, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _DigitShow($gui_digit[1], $rh)
    $h = @HOUR
    EndIf
    $lm = StringLeft(@MIN, 1)
    $rm = StringRight(@MIN, 1)
    If $m = -1 Or $lm <> StringLeft($m, 1) Then
    GuiCtrlDelete($gui_digit[2])
    sleep(1)
    $gui_digit[2] = GUICtrlCreateGraphic(120, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _DigitShow($gui_digit[2], $lm)
    GuiCtrlDelete($gui_digit[3])
    sleep(1)
    $gui_digit[3] = GUICtrlCreateGraphic(160, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _DigitShow($gui_digit[3], $rm)
    $m = @MIN
    ElseIf $m <> @MIN Then
    GuiCtrlDelete($gui_digit[3])
    sleep(1)
    $gui_digit[3] = GUICtrlCreateGraphic(160, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _DigitShow($gui_digit[3], $rm)
    $m = @MIN
    EndIf

    $ls = StringLeft(@SEC, 1)
    $rs = StringRight(@SEC, 1)
    If $s = -1 Or $ls <> StringLeft($s, 1) Then
    GuiCtrlDelete($gui_digit[4])
    sleep(1)
    $gui_digit[4] = GUICtrlCreateGraphic(220, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _DigitShow($gui_digit[4], $ls)
    GuiCtrlDelete($gui_digit[5])
    sleep(1)
    $gui_digit[5] = GUICtrlCreateGraphic(260, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _DigitShow($gui_digit[5], $rs)
    $s = @SEC
    ElseIf $s <> @SEC Then
    GuiCtrlDelete($gui_digit[5])
    sleep(1)
    $gui_digit[5] = GUICtrlCreateGraphic(260, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _DigitShow($gui_digit[5], $rs)
    $s = @SEC
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Colon($PosX, $PosY)
    GUICtrlCreateGraphic($PosX, $PosY, 10, 56)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 12, 10, 10)
    GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 36, 10, 10)
    EndFunc
    Func _DigitShow($digit, $number)
    Switch $number
    Case 0
    str_o($digit)
    str_ol($digit)
    str_or($digit)
    str_ul($digit)
    str_ur($digit)
    str_u($digit)
    Case 1
    str_or($digit)
    str_ur($digit)
    Case 2
    str_o($digit)
    str_or($digit)
    str_m($digit)
    str_ul($digit)
    str_u($digit)
    Case 3
    str_o($digit)
    str_or($digit)
    str_m($digit)
    str_ur($digit)
    str_u($digit)
    Case 4
    str_ol($digit)
    str_or($digit)
    str_m($digit)
    str_ur($digit)
    Case 5
    str_o($digit)
    str_ol($digit)
    str_m($digit)
    str_ur($digit)
    str_u($digit)
    Case 6
    str_ol($digit)
    str_m($digit)
    str_ul($digit)
    str_ur($digit)
    str_u($digit)
    Case 7
    str_o($digit)
    str_or($digit)
    str_ur($digit)
    Case 8
    str_o($digit)
    str_ol($digit)
    str_or($digit)
    str_m($digit)
    str_ul($digit)
    str_ur($digit)
    str_u($digit)
    Case 9
    str_o($digit)
    str_ol($digit)
    str_or($digit)
    str_m($digit)
    str_ur($digit)
    str_u($digit)
    EndSwitch
    GUICtrlSetGraphic($digit, $GUI_GR_REFRESH)
    EndFunc
    Func str_o($digit)
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 0)
    EndFunc
    Func str_ol($digit)
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 28)
    EndFunc
    Func str_or($digit)
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 28)
    EndFunc
    Func str_m($digit)
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 28)
    EndFunc
    Func str_ur($digit)
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 56)
    EndFunc
    Func str_ul($digit)
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    EndFunc
    Func str_u($digit)
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 56)
    EndFunc
    Func _MoveWindow()
    Local $DifX, $DifY, $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    Local $WinPos = WinGetPos(@GUI_WinHandle)
    Local $MPos = MouseGetPos()
    $DifX = $MPos[0] - $WinPos[0]
    $DifY = $MPos[1] - $WinPos[1]
    Do
    Sleep(15)
    $MPos = MouseGetPos()
    $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    Until ($WinPos[0] <> ($MPos[0] - $DifX)) Or ($WinPos[1] <> ($MPos[1] - $DifY)) Or (Not $MouseData[2])
    While $MouseData[2]
    $MPos = MouseGetPos()
    $WinPos = WinGetPos(@GUI_WinHandle)
    If ($WinPos[0] <> ($MPos[0] - $DifX)) Or ($WinPos[1] <> ($MPos[1] - $DifY)) Then
    WinMove(@GUI_WinHandle, '', $MPos[0] - $DifX, $MPos[1] - $DifY)
    EndIf
    Sleep(15)
    $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    WEnd
    EndFunc
    Func _End()
    Exit
    EndFunc

    [/autoit]

    MfG Schnuffel

    "Sarkasmus ist die niedrigste Form des Witzes, aber die höchste Form der Intelligenz."
    Val McDermid

    ein paar Infos ...

    Wer mehr als "nur" Hilfe benötigt, kann sich gern im Forum "Programmieranfragen" an uns wenden. Wir helfen in allen Fällen, die die Forenregeln zulassen.

    Für schnelle Hilfe benötigen wir ein ! lauffähiges ! Script, dass wir als Demonstration des Problems testen können. Wer von uns erwartet ein Teilscript erstmal lauffähig zu bekommen, der hat
    1. keine wirkliche Not
    2. keinen Respekt vor Menschen die ihm in ihrer Freizeit Ihre Hilfe anbieten
    3. oder ist einfach nur faul und meint wir coden das für ihn

    In solchen Fällen erlaube ich mir, die Anfrage einfach zu ignorieren. ;)

    • Offizieller Beitrag

    Es ist gut gemeint und Dein Script flackert auch nicht so stark, wie mein erster Versuch mit Delete/Neuzeichnen, aber für mich sieht es nun nach zwei Möglichkeiten aus:

    1. Änderungen an der Digitaluhr vornehmen und mit einer flackernden Anzeige leben. Allerdings kann man die Farbe frei wählen.
    oder
    2. Es bei den Icondateien belassen und die Farbe nicht beliebig ändern zu können. Dafür ohne flackern.


    Ich muss sagen, meine Entscheidung fällt deutlich zugunsten der 2. Möglichkeit aus. Sorry!

  • hey, kein Prob.
    ich hab mich angagiert, weil mich das Thema auch schon beschäftigt hat.
    Dabei kann man immer was lernen.
    Und wenn es ist, dass manches halt mit AutoIt nicht immer ganz so geht... ?(

    Ich würde es an Deiner Stelle genauso handhaben :thumbup:

    MfG Schnuffel

    "Sarkasmus ist die niedrigste Form des Witzes, aber die höchste Form der Intelligenz."
    Val McDermid

    ein paar Infos ...

    Wer mehr als "nur" Hilfe benötigt, kann sich gern im Forum "Programmieranfragen" an uns wenden. Wir helfen in allen Fällen, die die Forenregeln zulassen.

    Für schnelle Hilfe benötigen wir ein ! lauffähiges ! Script, dass wir als Demonstration des Problems testen können. Wer von uns erwartet ein Teilscript erstmal lauffähig zu bekommen, der hat
    1. keine wirkliche Not
    2. keinen Respekt vor Menschen die ihm in ihrer Freizeit Ihre Hilfe anbieten
    3. oder ist einfach nur faul und meint wir coden das für ihn

    In solchen Fällen erlaube ich mir, die Anfrage einfach zu ignorieren. ;)

  • finde ich. :thumbup:

    Seit meinen Arbeiten an SimplyColorProgress, The Stick und SiS ist auch mir eine Unregelmäßigkeit bei Verwendung von "GuiCtrlCreateGraphic" aufgefallen. Je größer die Fläche je größer das Flackern. In The Stick habe ich nur die Position gesetzt, also nur beim ersten einlesen. Dieses Flackern gibt es sogar in "multicolor", eben nur nicht so stark. ;(

    Meine Versuche mit Deiner Uhr zeigten große Sprünge der CPU-Last bis zu 25%. Änderungen dämmen das Problem nur mehr oder weniger ein.

    • Offizieller Beitrag

    Hallo,

    ich habe noch ein wenig mit deinem Problem experimentiert und glaube das eine ganz brauchbare Lösung rausgekommen ist!


    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <EditConstants.au3>
    #include <StaticConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt('MustDeclareVars', 1)
    Opt('GUIOnEventMode', 1)

    [/autoit] [autoit][/autoit] [autoit]

    Global $gui_digit[6], $dColor = 0xff2222, $eColor = 0x000000, $bgColor = 0xc0c0c0
    Global $s = -1, $m = -1, $h = -1, $hh, $hm, $hs, $ls, $rs

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate('test', 800, 480, -1, -1, $WS_POPUP, BitOr($WS_EX_TOOLWINDOW, $WS_EX_LAYERED))
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, '_MoveWindow')
    GUISetOnEvent($GUI_EVENT_CLOSE,'_End')
    GUISetBKColor($bgColor) ; Hintergrundfarbe setzen

    [/autoit] [autoit][/autoit] [autoit]

    $gui_digit[0] = GUICtrlCreateGraphic(20, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[1] = GUICtrlCreateGraphic(60, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _Colon(103, 20)
    $gui_digit[2] = GUICtrlCreateGraphic(120, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[3] = GUICtrlCreateGraphic(160, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    _Colon(203, 20)
    $gui_digit[4] = GUICtrlCreateGraphic(220, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[5] = GUICtrlCreateGraphic(260, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreatePic(@ScriptDir & '\nicht loeschen.gif', 0, 0, 1, 1) ; wird für die Transparenz benötigt (nicht löschen)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $hh = @HOUR
    If $hh <> $h Then
    GUISetState(@SW_LOCK)
    If $hh = "00" Then
    GUICtrlDelete($gui_digit[0])
    GUICtrlDelete($gui_digit[1])
    $gui_digit[0] = GUICtrlCreateGraphic(20, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[1] = GUICtrlCreateGraphic(60, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    EndIf
    $ls = StringLeft($hh, 1)
    $rs = StringRight($hh, 1)
    _DigitShow($gui_digit[0], $ls)
    _DigitShow($gui_digit[1], $rs)
    $h = $hh
    GUISetState(@SW_UNLOCK)
    EndIf

    $hm = @MIN
    If $hm <> $m Then
    GUISetState(@SW_LOCK)
    If $hm = "00" Then
    GUICtrlDelete($gui_digit[2])
    GUICtrlDelete($gui_digit[3])
    $gui_digit[2] = GUICtrlCreateGraphic(120, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[3] = GUICtrlCreateGraphic(160, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    EndIf
    $ls = StringLeft($hm, 1)
    $rs = StringRight($hm, 1)
    _DigitShow($gui_digit[2], $ls)
    _DigitShow($gui_digit[3], $rs)
    $m = $hm
    $h = -1
    GUISetState(@SW_UNLOCK)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $hs = @SEC
    If $hs <> $s Then
    GUISetState(@SW_LOCK)
    If $hs = "00" Then
    GUICtrlDelete($gui_digit[4])
    GUICtrlDelete($gui_digit[5])
    $gui_digit[4] = GUICtrlCreateGraphic(220, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    $gui_digit[5] = GUICtrlCreateGraphic(260, 20, 32, 56)
    GUICtrlSetBkColor(-1, $bgColor)
    EndIf
    $ls = StringLeft($hs, 1)
    $rs = StringRight($hs, 1)
    _DigitShow($gui_digit[4], $ls)
    _DigitShow($gui_digit[5], $rs)
    $s = $hs
    GUISetState(@SW_UNLOCK)
    EndIf
    Sleep(10)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Colon($PosX, $PosY)
    GUICtrlCreateGraphic($PosX, $PosY, 10, 56)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 12, 10, 10)
    GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 36, 10, 10)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _DigitShow($digit, $number)
    Switch $number ; g
    Case 2, 3, 4, 5, 6, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 28)
    Case 0, 1, 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 2, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 30, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 2, 28)
    EndSwitch
    Switch $number ; a
    Case 0, 2, 3, 5, 6, 7, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 0)
    Case 1, 4
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 1, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 31, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 1, 0)
    EndSwitch
    Switch $number ; b
    Case 0, 1, 2, 3, 4, 7, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 28)
    Case 5, 6
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 1)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 23)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 27)
    EndSwitch
    Switch $number ; c
    Case 0, 1, 3, 4, 5, 6, 7, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 56)
    Case 2
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 32, 29)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 55)
    EndSwitch
    Switch $number ; d
    Case 0, 2, 3, 5, 6, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 24, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 32, 56)
    Case 1, 4, 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 1, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 9, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 23, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 31, 56)
    EndSwitch
    Switch $number ; e
    Case 0, 2, 6, 8
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 28)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 32)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 48)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    Case 1, 3, 4, 5, 7, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 29)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 47)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 55)
    EndSwitch
    Switch $number ; f
    Case 0, 4, 5, 6, 8, 9
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $eColor, $dColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 8)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 24)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 28)
    Case 1, 2, 3, 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 1)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 23)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 27)
    EndSwitch
    Switch $Number
    Case 1
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 0)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    Case 4
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 33)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    Case 7
    GUICtrlSetGraphic($digit, $GUI_GR_COLOR, $bgColor, $bgColor)
    GUICtrlSetGraphic($digit, $GUI_GR_MOVE, 0, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 9)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 8, 56)
    GUICtrlSetGraphic($digit, $GUI_GR_LINE, 0, 56)
    EndSwitch
    GUICtrlSetGraphic($digit, $GUI_GR_REFRESH)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _MoveWindow()
    Local $DifX, $DifY, $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    Local $WinPos = WinGetPos(@GUI_WinHandle)
    Local $MPos = MouseGetPos()
    $DifX = $MPos[0] - $WinPos[0]
    $DifY = $MPos[1] - $WinPos[1]
    Do
    Sleep(15)
    $MPos = MouseGetPos()
    $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    Until ($WinPos[0] <> ($MPos[0] - $DifX)) Or ($WinPos[1] <> ($MPos[1] - $DifY)) Or (Not $MouseData[2])
    While $MouseData[2]
    $MPos = MouseGetPos()
    $WinPos = WinGetPos(@GUI_WinHandle)
    If ($WinPos[0] <> ($MPos[0] - $DifX)) Or ($WinPos[1] <> ($MPos[1] - $DifY)) Then
    WinMove(@GUI_WinHandle, '', $MPos[0] - $DifX, $MPos[1] - $DifY)
    EndIf
    Sleep(15)
    $MouseData = GUIGetCursorInfo(@GUI_WinHandle)
    WEnd
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _End()
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit]
  • ich hab das Script von Bernd mal laufen lassen.
    Ich finde dass das auch noch flackert und den Speicher "hochzählt".
    CPU-Last tendenziell steigend bis max. 10% nach 5 Minuten.

    Nebenbei hab ich bemerkt, wenn ich während die Uhr läuft eine Ultra-VNC Session offen habe, dass im SekundenTackt mein VNC-Fenster Aus-/An geht.

    Vielleicht könnt Ihr das ja mal nachstellen...

    Vielleicht kann man den Bug ja wirklich mal nach USA-Land schicken. Liegt auf jeden Fall an GuiCtrlCreateGraphic.

    So long... ^^

    MfG Schnuffel

    "Sarkasmus ist die niedrigste Form des Witzes, aber die höchste Form der Intelligenz."
    Val McDermid

    ein paar Infos ...

    Wer mehr als "nur" Hilfe benötigt, kann sich gern im Forum "Programmieranfragen" an uns wenden. Wir helfen in allen Fällen, die die Forenregeln zulassen.

    Für schnelle Hilfe benötigen wir ein ! lauffähiges ! Script, dass wir als Demonstration des Problems testen können. Wer von uns erwartet ein Teilscript erstmal lauffähig zu bekommen, der hat
    1. keine wirkliche Not
    2. keinen Respekt vor Menschen die ihm in ihrer Freizeit Ihre Hilfe anbieten
    3. oder ist einfach nur faul und meint wir coden das für ihn

    In solchen Fällen erlaube ich mir, die Anfrage einfach zu ignorieren. ;)

    • Offizieller Beitrag

    OH NEIN!

    Komme gerade vom Einkaufen wieder (Script habe ich laufen lassen) und sehe die Zahlen flackern. Das kann doch nicht wahr sein!
    Außerdem hat sich innerhalb von 45 Minuten die Speicherauslastung um 100 KB erhöht und die CPU-Auslastung ist auf 3 % (vorher 1 %) gestiegen.

    Da stimmt doch was mit den Graphic-Controls nicht! ?(
    Das funktionierte ja auf dem C64 besser (Sprite-Programmierung)! ;)

    Das mit dem melden an die AutoIt-Entwickler sollte besser jemand übernehmen, der besser englisch kann als ich.

  • Zitat

    Vielleicht kann man das in den AutoIt-Bugtracker packen?
    Also eine Funktion GUICTRLGraphicsReset erbitten oder so...

    Klang doch so, als ob pee sich da angeboten hätte, oder???
    :thumbup:

    MfG Schnuffel

    "Sarkasmus ist die niedrigste Form des Witzes, aber die höchste Form der Intelligenz."
    Val McDermid

    ein paar Infos ...

    Wer mehr als "nur" Hilfe benötigt, kann sich gern im Forum "Programmieranfragen" an uns wenden. Wir helfen in allen Fällen, die die Forenregeln zulassen.

    Für schnelle Hilfe benötigen wir ein ! lauffähiges ! Script, dass wir als Demonstration des Problems testen können. Wer von uns erwartet ein Teilscript erstmal lauffähig zu bekommen, der hat
    1. keine wirkliche Not
    2. keinen Respekt vor Menschen die ihm in ihrer Freizeit Ihre Hilfe anbieten
    3. oder ist einfach nur faul und meint wir coden das für ihn

    In solchen Fällen erlaube ich mir, die Anfrage einfach zu ignorieren. ;)