Digits

  • Hier mein erster Versuch mit GDI
    Soll mal eine Digi-Uhr fürn Desktop werden
    Zur Zeit besteht mein Problem darin,daß sich das laufende (noch nicht fertige) Programm weder durch ESC noch X-Fensterbutton abbrechen lässt.Es hängt auf alle Fälle mit der Sleep time in der While-Schleife zusammen,doch wenn ich sie runtersetze,flackert es.

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Include <Date.au3>
    #include <GDIPlus.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("", 300, 400, 392, 124)
    GUICtrlSetFont(-1, 20, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    #region Declaration
    Global $x=100
    Global $y=100
    Global $x1=170
    $x2=200
    $x3=170
    $x4=300
    dim $ziffer[10]
    $ziffer[1]="0.0.1.1.0.0.0.0.0.0.0.1.1.1.1.0.0.0.0.0.0"
    $ziffer[2]="1.0.0.1.1.1.1.0.0.1.1.1.1.0.0.1.1.1.1.1.1"
    $ziffer[3]="0.0.1.1.1.1.1.0.0.0.0.1.1.1.1.1.1.1.1.1.1"
    $ziffer[4]="0.1.1.1.0.1.0.1.1.0.0.1.1.1.1.0.0.1.1.0.0"
    $ziffer[5]="0.1.1.0.1.1.1.1.1.0.0.0.0.1.1.1.1.1.1.1.1"
    $ziffer[6]="1.1.1.0.0.1.1.1.1.1.1.0.0.1.1.0.0.1.1.1.1"
    $ziffer[7]="0.0.1.1.1.0.0.0.0.0.0.1.1.1.1.1.1.0.0.0.0"
    $ziffer[8]="1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1"
    $ziffer[9]="0.1.1.1.1.1.0.1.1.0.0.1.1.1.1.1.1.1.1.0.0"
    $ziffer[0]="1.1.1.1.1.0.1.1.1.1.1.1.1.1.1.1.1.0.0.1.1"

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

    dim $dreieck[4][2]
    dim $dreieck1[4][2]
    dim $dreieck2[4][2]
    dim $dreieck3[4][2]
    dim $dreieck4[4][2]
    dim $dreieck5[4][2]
    dim $dreieck6[4][2]
    dim $dreieck7[4][2]
    dim $dreieck8[4][2]
    dim $dreieck9[4][2]
    dim $dreieck10[4][2]
    dim $dreieck11[4][2]
    dim $dreieck12[4][2]
    dim $dreieck13[4][2]
    $d =$x &": "&$x &":"&$x+10 &":"&$x &":" &$x+5 &":"&$x-5
    $d1=$x &":" &$x2&":"&$x+10 &":"&$x2&":" &$x+5 &":"&$x2+5
    $d2=$x &":" &$x2+10 &":"&$x+10 &":"&$x2+10 &":" &$x+5 &":"&$x2+5
    $d3=$x &":" &$x4+10 &":"&$x+10 &":"&$x4+10 &":" &$x+5 &":"&$x4+15
    $d4=$x3&":" &$x &":"&$x3+10 &":"&$x &":" &$x3+5 &":"&$x-5
    $d5=$x3&":" &$x2&":"&$x3+10 &":"&$x2&":" &$x3+5 &":"&$x2+5
    $d6=$x3&":" &$x2+10 &":"&$x3+10 &":"&$x2+10 &":" &$x3+5 &":"&$x2+5
    $d7=$x3&":" &$x4+10 &":"&$x3+10 &":"&$x4+10 &":" &$x3+5 &":"&$x4+15
    $d8=$x+10 &": "&$x-5 &":"&$x+20 &":"&$x-10 &":" &$x+20 &":"&$x
    $d9=$x+70 &": "&$x-5 &":"&$x+60 &":"&$x-10 &":" &$x+60 &":"&$x
    $d10=$x+10 &": "&$x2+5 &":"&$x+20 &":"&$x2&":" &$x+20 &":"&$x2+10
    $d11=$x+70 &": "&$x2+5 &":"&$x+60 &":"&$x2&":" &$x+60 &":"&$x2+10
    $d12=$x+10 &": "&$x4+15 &":"&$x+20 &":"&$x4+10 &":" &$x+20 &":"&$x4+20
    $d13=$x+70 &": "&$x4+15 &":"&$x+60 &":"&$x4+10 &":" &$x+60 &":"&$x4+20
    arrayfill($dreieck,$d)
    arrayfill($dreieck1,$d1)
    arrayfill($dreieck2,$d2)
    arrayfill($dreieck3,$d3)
    arrayfill($dreieck4,$d4)
    arrayfill($dreieck5,$d5)
    arrayfill($dreieck6,$d6)
    arrayfill($dreieck7,$d7)
    arrayfill($dreieck8,$d8)
    arrayfill($dreieck9,$d9)
    arrayfill($dreieck10,$d10)
    arrayfill($dreieck11,$d11)
    arrayfill($dreieck12,$d12)
    arrayfill($dreieck13,$d13)
    #endregion

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

    _GDIPlus_Startup()
    Global $grafik=_GDIPlus_GraphicsCreateFromHWND($Form1)
    Global $Brush = _GDIPlus_BrushCreateSolid(0xFF1234FF)
    Global $Brush1 = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    _GDIPlus_GraphicsClear($grafik,0xFFffffff)

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

    While 1
    $uhr=_NowTime(5)
    $zeit=StringSplit($uhr,":")
    $b=stringright($zeit[3],1)
    Select
    case $b="0"
    _1($ziffer[0])
    case $b="1"
    _1($ziffer[1])
    case $b="2"
    _1($ziffer[2])
    case $b="3"
    _1($ziffer[3])
    case $b="4"
    _1($ziffer[4])
    case $b="5"
    _1($ziffer[5])
    case $b="6"
    _1($ziffer[6])
    case $b="7"
    _1($ziffer[7])
    case $b="8"
    _1($ziffer[8])
    case $b="9"
    _1($ziffer[9])
    EndSelect
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    Sleep(1000)
    _GDIPlus_GraphicsClear($grafik,0xFFffffff)
    WEnd
    _GDIPlus_GraphicsDispose($grafik)
    _GDIPlus_Shutdown()

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

    func _1(ByRef $ziffer)
    $teil=StringSplit($ziffer,".")
    if $teil[1]=1 then $strichsenkrecht1=_GDIPlus_GraphicsfillRect($grafik,$x,$y+110,10,$x,$Brush)
    if $teil[2]=1 then $strichsenkrecht2=_GDIPlus_GraphicsfillRect($grafik,$x,$y,10,$x,$Brush)
    if $teil[3]=1 then $strichsenkrecht3=_GDIPlus_GraphicsfillRect($grafik,$x1,$y+110,10,$x,$Brush)
    if $teil[4]=1 then $strichsenkrecht4=_GDIPlus_GraphicsfillRect($grafik,$x1,$y,10,$x,$Brush)

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

    if $teil[5]=1 then $strichwaagerecht1=_GDIPlus_GraphicsfillRect($grafik,$x+20,$y-10,40,10,$Brush)
    if $teil[6]=1 then $strichwaagerecht2=_GDIPlus_GraphicsfillRect($grafik,$x+20,$y+100,40,10,$Brush)
    if $teil[7]=1 then $strichwaagerecht3=_GDIPlus_GraphicsfillRect($grafik,$x+20,$y+210,40,10,$Brush)

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

    if $teil[8]=1 then $dreiecksenkrecht1=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck,$Brush)
    if $teil[9]=1 then $dreiecksenkrecht2=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck1,$Brush)
    if $teil[10]=1 then $dreiecksenkrecht3=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck2,$Brush)
    if $teil[11]=1 then $dreiecksenkrecht4=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck3,$Brush)

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

    if $teil[12]=1 then $dreiecksenkrecht5=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck4,$Brush)
    if $teil[13]=1 then $dreiecksenkrecht6=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck5,$Brush)
    if $teil[14]=1 then $dreiecksenkrecht7=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck6,$Brush)
    if $teil[15]=1 then $dreiecksenkrecht8=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck7,$Brush)

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

    if $teil[16]=1 then $dreieckwaagerecht1=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck8,$Brush)
    if $teil[17]=1 then $dreieckwaagerecht2=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck9,$Brush)
    if $teil[18]=1 then $dreieckwaagerecht3=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck10,$Brush)
    if $teil[19]=1 then $dreieckwaagerecht4=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck11,$Brush)
    if $teil[20]=1 then $dreieckwaagerecht5=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck12,$Brush)
    if $teil[21]=1 then $dreieckwaagerecht6=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck13,$Brush)
    EndFunc

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

    func arrayfill(byref $dreieck,$coords)
    $a2=StringSplit($coords,":")
    $1=1
    $2=0
    for $q=1 to 6
    $dreieck[0][0]=3
    $dreieck[$1][$2]=$a2[$q]
    if $2=0 then
    $2=1
    else
    $2=0
    $1+=1
    EndIf
    Next
    return $dreieck
    EndFunc

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


    OK,fürs erste mit Hotkey gelöst

    So jetzt isses erst mal lauffähig
    hoffe auf verbesserungsvorschläge ( versucht mal rechtsklick auf die Uhr-->> ist zur zeit meine baustelle---<<< Anregungen unbedingt erwünscht

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Include <Array.au3>
    #include <GDIPlus.au3>
    #Include <Date.au3>
    #Include <String.au3>
    #region
    HotKeySet("{ESC}", "ende")
    Local $offset1=0,$offset2=0,$neu="",$senkrecht="50,10,55,15,55,95,50,100,45,95,45,15",$waagerecht="55,10,60,5,100,5,105,10,100,15,60,15"
    Global $array[43],$wo[7],$wo2[7][8],$segmentort1[7][8],$array2[7][2],$array3[7][2],$ziffer[7],$trans=255
    $ziffer[1]="1,2,13,14,25,31,37"
    $ziffer[2]="3,4,15,16,26,32,38"
    $ziffer[3]="5,6,17,18,27,33,39"
    $ziffer[4]="7,8,19,20,28,34,40"
    $ziffer[5]="9,10,21,22,29,35,41"
    $ziffer[6]="11,12,23,24,30,36,42"
    for $a=1 to 24
    $teil=StringSplit($senkrecht,",")
    for $teil1=1 to 11 step 2
    $teil[$teil1]=$teil[$teil1]+$offset1
    next
    for $teil1=2 to 12 step 2
    $teil[$teil1]=$teil[$teil1]+$offset2
    next
    for $teil1=1 to 12
    $neu=$neu&$teil[$teil1]&","
    Next
    $neu=StringTrimRight($neu,1)
    $array[$a]=$neu
    $offset1+=60
    $neu=""
    if $a=12 then
    $offset1=0
    $offset2=90
    EndIf
    Next
    Local $offset1=0,$offset2=0
    for $a=25 to 42
    $teil=StringSplit($waagerecht,",")
    for $teil1=1 to 11 step 2
    $teil[$teil1]=$teil[$teil1]+$offset1
    next
    for $teil1=2 to 12 step 2
    $teil[$teil1]=$teil[$teil1]+$offset2
    next
    for $teil1=1 to 12
    $neu=$neu&$teil[$teil1]&","
    Next
    $neu=StringTrimRight($neu,1)
    $array[$a]=$neu
    $offset1+=120
    $neu=""
    if $a=30 then
    $offset1=0
    $offset2=90
    EndIf
    if $a=36 then
    $offset1=0
    $offset2=180
    EndIf
    Next
    #endregion

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

    #region
    $Form1 = GUICreate("1", 800,200, 100, 205,$WS_POPUP)
    GUISetBkColor(0x000000)

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

    GUISetState()
    _GDIPlus_Startup()
    Global $grafik=_GDIPlus_GraphicsCreateFromHWND($Form1)
    Global $Brush = _GDIPlus_BrushCreateSolid(0xff00bb00)
    Global $Brush1 = _GDIPlus_BrushCreateSolid(0xFF000000)
    #endregion

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

    While 1

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

    $nMsg = GUIGetMsg()
    $maus=GUIGetCursorInfo ($Form1)
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_GraphicsDispose($grafik)
    _GDIPlus_Shutdown()
    Exit
    EndSwitch
    Select
    case $maus[3]=1
    if not WinExists("2","") then optionen()
    EndSelect
    uhrzeit()
    WEnd

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

    func optionen()
    $Form2 = GUICreate("2", 800,50, 100, 405,$WS_POPUP)
    GUISetBkColor(0xFFFFFF)
    $exitbutton=GUICtrlCreateButton("Fertig",750,10,40,30)
    $transslider=GUICtrlCreateSlider(10,10,150,30)
    GUICtrlSetBkColor(-1,0xFFFFFF)
    GUICtrlSetLimit(-1, 250,0)
    GUISetState()
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $exitbutton
    GUIDelete($Form2)
    ExitLoop
    case $transslider
    $trans=GUICtrlRead($transslider)
    GUISetBkColor(RGB2BGR($trans),$Form1)
    _GDIPlus_BrushSetSolidColor($Brush1,_StringInsert(RGB2BGR($trans),"FF",2))
    EndSwitch
    WEnd
    EndFunc

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

    Func uhrzeit()
    $uhr=_NowTime(5)
    $zeit=StringSplit($uhr,":")
    $St1 =StringLeft ($zeit[1],1)
    $St2 =StringRight($zeit[1],1)
    $Min1=StringLeft ($zeit[2],1)
    $Min2=StringRight($zeit[2],1)
    $Sek1=StringLeft ($zeit[3],1)
    $Sek2=StringRight($zeit[3],1)
    ziffer($St1 ,1)
    ziffer($St2 ,2)
    ziffer($Min1,3)
    ziffer($Min2,4)
    ziffer($Sek1,5)
    ziffer($Sek2,6)
    $Stunde1 =StringSplit($ziffer[1],",")
    $Stunde2 =StringSplit($ziffer[2],",")
    $Minute1 =StringSplit($ziffer[3],",")
    $Minute2 =StringSplit($ziffer[4],",")
    $Sekunde1=StringSplit($ziffer[5],",")
    $Sekunde2=StringSplit($ziffer[6],",")
    $wo[0]=$uhr
    for $a = 1 to 6
    for $b=1 to 7
    $segmentort=StringSplit($ziffer[$a],",")
    $wo1=StringSplit($wo[$a],",")
    $wo2[$a][$b]=$wo1[$b]
    if $wo2[$a][$b]=1 then
    $segmentort1[$a][$b]="1|"&$segmentort[$b]
    Else
    $segmentort1[$a][$b]="0|"&$segmentort[$b]
    EndIf
    Next
    Next
    segment()
    EndFunc

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

    func ziffer(ByRef $zeit,$segment)
    Select
    case $zeit="0"
    $wo[$segment]="1,1,1,1,1,0,1"
    case $zeit="1"
    $wo[$segment]="0,1,0,1,0,0,0"
    case $zeit="2"
    $wo[$segment]="0,1,1,0,1,1,1"
    case $zeit="3"
    $wo[$segment]="0,1,0,1,1,1,1"
    case $zeit="4"
    $wo[$segment]="1,1,0,1,0,1,0"
    case $zeit="5"
    $wo[$segment]="1,0,0,1,1,1,1"
    case $zeit="6"
    $wo[$segment]="1,0,1,1,1,1,1"
    case $zeit="7"
    $wo[$segment]="0,1,0,1,1,0,0"
    case $zeit="8"
    $wo[$segment]="1,1,1,1,1,1,1"
    case $zeit="9"
    $wo[$segment]="1,1,0,1,1,1,0"
    EndSelect
    return $wo
    EndFunc

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

    Func segment()
    Local $px1=250, $px2=495,$ww=""
    _GDIPlus_GraphicsFillEllipse($grafik,$px1,60, 15, 15,$Brush1)
    _GDIPlus_GraphicsFillEllipse($grafik,$px1,120, 15, 15,$Brush1)
    _GDIPlus_GraphicsFillEllipse($grafik,$px2,60, 15, 15,$Brush1)
    _GDIPlus_GraphicsFillEllipse($grafik,$px2,120, 15, 15,$Brush1)
    Sleep(500)
    for $a = 1 to 6
    For $b=1 to 7
    $ww=$ww&$segmentort1[$a][$b]&","
    Next
    Next
    $ww1=StringSplit($ww,",")
    for $a=1 to 42
    if StringLeft($ww1[$a],1)="1" then
    $senkrecht1=StringSplit($array[StringTrimLeft($ww1[$a],2)],",")
    $array2[0][0]=6
    $array2[1][0]=$senkrecht1[1]
    $array2[1][1]=$senkrecht1[2]
    $array2[2][0]=$senkrecht1[3]
    $array2[2][1]=$senkrecht1[4]
    $array2[3][0]=$senkrecht1[5]
    $array2[3][1]=$senkrecht1[6]
    $array2[4][0]=$senkrecht1[7]
    $array2[4][1]=$senkrecht1[8]
    $array2[5][0]=$senkrecht1[9]
    $array2[5][1]=$senkrecht1[10]
    $array2[6][0]=$senkrecht1[11]
    $array2[6][1]=$senkrecht1[12]
    _GDIPlus_GraphicsFillPolygon($grafik,$array2,$Brush)
    Else
    $senkrecht1=StringSplit($array[StringTrimLeft($ww1[$a],2)],",")
    $array2[0][0]=6
    $array2[1][0]=$senkrecht1[1]
    $array2[1][1]=$senkrecht1[2]
    $array2[2][0]=$senkrecht1[3]
    $array2[2][1]=$senkrecht1[4]
    $array2[3][0]=$senkrecht1[5]
    $array2[3][1]=$senkrecht1[6]
    $array2[4][0]=$senkrecht1[7]
    $array2[4][1]=$senkrecht1[8]
    $array2[5][0]=$senkrecht1[9]
    $array2[5][1]=$senkrecht1[10]
    $array2[6][0]=$senkrecht1[11]
    $array2[6][1]=$senkrecht1[12]
    _GDIPlus_GraphicsFillPolygon($grafik,$array2,$Brush1)
    EndIf
    Next
    _GDIPlus_GraphicsFillEllipse($grafik,$px1,60, 15, 15,$Brush)
    _GDIPlus_GraphicsFillEllipse($grafik,$px1,120, 15, 15,$Brush)
    _GDIPlus_GraphicsFillEllipse($grafik,$px2,60, 15, 15,$Brush)
    _GDIPlus_GraphicsFillEllipse($grafik,$px2,120, 15, 15,$Brush)
    sleep(500)
    EndFunc

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

    func ende()
    _GDIPlus_GraphicsDispose($grafik)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

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

    Func RGB2BGR($iColor)
    Local $sH = Hex($iColor,6)
    Return '0x' & StringRight($sH, 2) & StringMid($sH,3,2) & StringLeft($sH, 2)
    EndFunc

    [/autoit]

    wenn ich euch damit nerve,sagt bescheid,dann schließe ich dasThema

    3 Mal editiert, zuletzt von TAFFY (12. September 2010 um 18:54)

  • soweit so naja
    Hab die Digits jetzt auf die komplette uhrzeit angewendet,jetzt mein Problem
    ES FLACKERT.hab zwar mal was von Buffer oder so gelesen,schön wäre ne fundierte Erklärung
    wie gesagt gdi ist Neuland für mich
    vllt gibts ja noch ein paar tipps,wie ich meine obskure Lösung mit den verschiedenen GUIs vermeiden kann.in der taskleiste erscheinen nähmlich immer jene --->>> unprofessionell?? btw,kann mann die GUI auch transparenten??

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Include <Date.au3>
    #include <GDIPlus.au3>

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

    HotKeySet("{ESC}", "ende")
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("", 100,250, 1170, 5,$WS_POPUP)
    GUISetState()
    $Form11 = GUICreate("", 100,250,1062, 5,$WS_POPUP)
    GUISetState()
    $Form2 = GUICreate("", 100,250, 940, 5,$WS_POPUP)
    GUISetState()
    $Form21 = GUICreate("", 100,250,832, 5,$WS_POPUP)
    GUISetState()
    $Form3 = GUICreate("", 100,250, 710, 5,$WS_POPUP)
    GUISetState()
    $Form31 = GUICreate("", 100,250,602, 5,$WS_POPUP)
    GUISetState()
    #EndRegion ### END Koda GUI section ###

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

    #region Declaration
    Global $hoch=100
    Global $breit=40
    Global $x =10
    Global $x1=80
    $x2=110
    $x3=80
    $x4=210
    Global $y =20
    $y2=120
    $y4=220
    dim $ziffer[10]
    $ziffer[1]="0.0.1.1.0.0.0.0.0.0.0.1.1.1.1.0.0.0.0.0.0"
    $ziffer[2]="1.0.0.1.1.1.1.0.0.1.1.1.1.0.0.1.1.1.1.1.1"
    $ziffer[3]="0.0.1.1.1.1.1.0.0.0.0.1.1.1.1.1.1.1.1.1.1"
    $ziffer[4]="0.1.1.1.0.1.0.1.1.0.0.1.1.1.1.0.0.1.1.0.0"
    $ziffer[5]="0.1.1.0.1.1.1.1.1.0.0.0.0.1.1.1.1.1.1.1.1"
    $ziffer[6]="1.1.1.0.0.1.1.1.1.1.1.0.0.1.1.0.0.1.1.1.1"
    $ziffer[7]="0.0.1.1.1.0.0.0.0.0.0.1.1.1.1.1.1.0.0.0.0"
    $ziffer[8]="1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1"
    $ziffer[9]="0.1.1.1.1.1.0.1.1.0.0.1.1.1.1.1.1.1.1.0.0"
    $ziffer[0]="1.1.1.1.1.0.1.1.1.1.1.1.1.1.1.1.1.0.0.1.1"

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

    dim $dreieck[4][2]
    dim $dreieck1[4][2]
    dim $dreieck2[4][2]
    dim $dreieck3[4][2]
    dim $dreieck4[4][2]
    dim $dreieck5[4][2]
    dim $dreieck6[4][2]
    dim $dreieck7[4][2]
    dim $dreieck8[4][2]
    dim $dreieck9[4][2]
    dim $dreieck10[4][2]
    dim $dreieck11[4][2]
    dim $dreieck12[4][2]
    dim $dreieck13[4][2]
    $d =$x &": "&$y &":"&$x+10 &":"&$y &":" &$x+5 &":"&$y-5
    $d1=$x &":" &$y2 &":"&$x+10 &":"&$y2 &":" &$x+5 &":"&$y2+5
    $d2=$x &":" &$y2+10 &":"&$x+10 &":"&$y2+10 &":" &$x+5 &":"&$y2+5
    $d3=$x &":" &$y4+10 &":"&$x+10 &":"&$y4+10 &":" &$x+5 &":"&$y4+15
    $d4=$x3 &":" &$y &":"&$x3+10 &":"&$y &":" &$x3+5 &":"&$y-5
    $d5=$x3 &":" &$y2 &":"&$x3+10 &":"&$y2 &":" &$x3+5 &":"&$y2+5
    $d6=$x3 &":" &$y2+10 &":"&$x3+10 &":"&$y2+10 &":" &$x3+5 &":"&$y2+5
    $d7=$x3 &":" &$y4+10 &":"&$x3+10 &":"&$y4+10 &":" &$x3+5 &":"&$y4+15
    $d8=$x+10 &": "&$y-5 &":"&$x+20 &":"&$y-10 &":" &$x+20 &":"&$y
    $d9=$x+70 &": "&$y-5 &":"&$x+60 &":"&$y-10 &":" &$x+60 &":"&$y
    $d10=$x+10 &": "&$y2+5 &":"&$x+20 &":"&$y2 &":" &$x+20 &":"&$y2+10
    $d11=$x+70 &": "&$y2+5 &":"&$x+60 &":"&$y2 &":" &$x+60 &":"&$y2+10
    $d12=$x+10 &": "&$y4+15 &":"&$x+20 &":"&$y4+10 &":" &$x+20 &":"&$y4+20
    $d13=$x+70 &": "&$y4+15 &":"&$x+60 &":"&$y4+10 &":" &$x+60 &":"&$y4+20
    arrayfill($dreieck,$d)
    arrayfill($dreieck1,$d1)
    arrayfill($dreieck2,$d2)
    arrayfill($dreieck3,$d3)
    arrayfill($dreieck4,$d4)
    arrayfill($dreieck5,$d5)
    arrayfill($dreieck6,$d6)
    arrayfill($dreieck7,$d7)
    arrayfill($dreieck8,$d8)
    arrayfill($dreieck9,$d9)
    arrayfill($dreieck10,$d10)
    arrayfill($dreieck11,$d11)
    arrayfill($dreieck12,$d12)
    arrayfill($dreieck13,$d13)
    #endregion

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

    _GDIPlus_Startup()
    $grafik=_GDIPlus_GraphicsCreateFromHWND($Form1)
    $grafik1=_GDIPlus_GraphicsCreateFromHWND($Form11)
    $grafik2=_GDIPlus_GraphicsCreateFromHWND($Form2)
    $grafik3=_GDIPlus_GraphicsCreateFromHWND($Form21)
    $grafik4=_GDIPlus_GraphicsCreateFromHWND($Form3)
    $grafik5=_GDIPlus_GraphicsCreateFromHWND($Form31)
    Global $Brush = _GDIPlus_BrushCreateSolid(0xff00bb00)
    _GDIPlus_GraphicsClear($grafik,0x00ffffff)
    _GDIPlus_GraphicsClear($grafik1,0x00ffffff)
    _GDIPlus_GraphicsClear($grafik2,0x00ffffff)
    _GDIPlus_GraphicsClear($grafik3,0x00ffffff)
    _GDIPlus_GraphicsClear($grafik4,0x00ffffff)
    _GDIPlus_GraphicsClear($grafik5,0x00ffffff)
    While 1
    $uhr=_NowTime(5)
    $zeit=StringSplit($uhr,":")
    $b=stringright($zeit[3],1)
    $c=stringleft($zeit[3],1)
    $e=stringright($zeit[2],1)
    $f=stringleft($zeit[2],1)
    $g=stringright($zeit[1],1)
    $h=stringleft($zeit[1],1)
    ziffer( $b,$grafik)
    ziffer( $c,$grafik1)
    ziffer( $e,$grafik2)
    ziffer( $f,$grafik3)
    ziffer( $g,$grafik4)
    ziffer( $h,$grafik5)
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    Sleep(1000)
    _GDIPlus_GraphicsClear($grafik,0x00ffffff)
    _GDIPlus_GraphicsClear($grafik1,0x00ffffff)
    _GDIPlus_GraphicsClear($grafik2,0x00ffffff)
    _GDIPlus_GraphicsClear($grafik3,0x00ffffff)
    _GDIPlus_GraphicsClear($grafik4,0x00ffffff)
    _GDIPlus_GraphicsClear($grafik5,0x00ffffff)
    WEnd
    _GDIPlus_GraphicsDispose($grafik)
    _GDIPlus_Shutdown()

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

    func ziffer(ByRef $b,$gra)
    Select
    case $b="0"
    _1($ziffer[0],$gra)
    case $b="1"
    _1($ziffer[1],$gra)
    case $b="2"
    _1($ziffer[2],$gra)
    case $b="3"
    _1($ziffer[3],$gra)
    case $b="4"
    _1($ziffer[4],$gra)
    case $b="5"
    _1($ziffer[5],$gra)
    case $b="6"
    _1($ziffer[6],$gra)
    case $b="7"
    _1($ziffer[7],$gra)
    case $b="8"
    _1($ziffer[8],$gra)
    case $b="9"
    _1($ziffer[9],$gra)
    EndSelect
    EndFunc

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

    func _1(ByRef $ziffer,$grafik)
    $teil=StringSplit($ziffer,".")
    if $teil[1]=1 then $strichsenkrecht1=_GDIPlus_GraphicsfillRect($grafik,$x,$y2+10,10,$hoch,$Brush)
    if $teil[2]=1 then $strichsenkrecht2=_GDIPlus_GraphicsfillRect($grafik,$x,$y,10,$hoch,$Brush)
    if $teil[3]=1 then $strichsenkrecht3=_GDIPlus_GraphicsfillRect($grafik,$x1,$y2+10,10,$hoch,$Brush)
    if $teil[4]=1 then $strichsenkrecht4=_GDIPlus_GraphicsfillRect($grafik,$x1,$y,10,$hoch,$Brush)

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

    if $teil[5]=1 then $strichwaagerecht1=_GDIPlus_GraphicsfillRect($grafik,$x+20,$y-10,$breit,10,$Brush)
    if $teil[6]=1 then $strichwaagerecht2=_GDIPlus_GraphicsfillRect($grafik,$x+20,$y2,$breit,10,$Brush)
    if $teil[7]=1 then $strichwaagerecht3=_GDIPlus_GraphicsfillRect($grafik,$x+20,$y4+10,$breit,10,$Brush)

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

    if $teil[8]=1 then $dreiecksenkrecht1=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck,$Brush)
    if $teil[9]=1 then $dreiecksenkrecht2=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck1,$Brush)
    if $teil[10]=1 then $dreiecksenkrecht3=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck2,$Brush)
    if $teil[11]=1 then $dreiecksenkrecht4=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck3,$Brush)

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

    if $teil[12]=1 then $dreiecksenkrecht5=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck4,$Brush)
    if $teil[13]=1 then $dreiecksenkrecht6=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck5,$Brush)
    if $teil[14]=1 then $dreiecksenkrecht7=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck6,$Brush)
    if $teil[15]=1 then $dreiecksenkrecht8=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck7,$Brush)

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

    if $teil[16]=1 then $dreieckwaagerecht1=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck8,$Brush)
    if $teil[17]=1 then $dreieckwaagerecht2=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck9,$Brush)
    if $teil[18]=1 then $dreieckwaagerecht3=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck10,$Brush)
    if $teil[19]=1 then $dreieckwaagerecht4=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck11,$Brush)
    if $teil[20]=1 then $dreieckwaagerecht5=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck12,$Brush)
    if $teil[21]=1 then $dreieckwaagerecht6=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck13,$Brush)
    EndFunc

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

    func arrayfill(byref $dreieck,$coords)
    $a2=StringSplit($coords,":")
    $1=1
    $2=0
    for $q=1 to 6
    $dreieck[0][0]=3
    $dreieck[$1][$2]=$a2[$q]
    if $2=0 then
    $2=1
    else
    $2=0
    $1+=1
    EndIf
    Next
    return $dreieck
    EndFunc

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

    func ende()
    Exit
    _GDIPlus_GraphicsDispose($grafik)
    _GDIPlus_Shutdown()
    EndFunc

    [/autoit]


    achso,wenn das jemand testen will,obacht ,ist auf 1280x1024 geeicht
    ggf die positionen der GUIs ändern,aber wem sag ich das

  • hi
    also erst mal zu deiner ende funktion^^

    Spoiler anzeigen
    [autoit]

    func ende()
    Exit
    _GDIPlus_GraphicsDispose($grafik)
    _GDIPlus_Shutdown()
    EndFunc

    [/autoit]

    wenn du willst das shutdown was bringt musst du soweit ich weis es vor dem Exit machen, da sonst es nciht mehr ausgeführt wird^^

    dann zu deiner frage mit den Guis...
    Ich hab mal kurz was getestet was doof aussieht aber es geht^^
    du kannst doch einfach nur eine Große GUI machen und dann zB deine erste zahl schreiben und dann deine 2. versetzt dazu....

    Spoiler anzeigen
    [autoit]

    func _1(ByRef $ziffer,$grafik, $xDiff = 0)
    $teil=StringSplit($ziffer,".")
    if $teil[1]=1 then $strichsenkrecht1=_GDIPlus_GraphicsfillRect($grafik,$x + $xDiff,$y2+10,10,$hoch,$Brush)
    if $teil[2]=1 then $strichsenkrecht2=_GDIPlus_GraphicsfillRect($grafik,$x + $xDiff,$y,10,$hoch,$Brush)
    if $teil[3]=1 then $strichsenkrecht3=_GDIPlus_GraphicsfillRect($grafik,$x1 + $xDiff,$y2+10,10,$hoch,$Brush)
    if $teil[4]=1 then $strichsenkrecht4=_GDIPlus_GraphicsfillRect($grafik,$x1 + $xDiff,$y,10,$hoch,$Brush)

    [/autoit]


    so zb als ausschnitt und dann fängste für die erste zahl halt mit 0 an und dann versetzt du dann die 2. zahl einfach...
    ich bastel mal was etwas schöner aussieht als das was ich grad hab ^^

    EDIT:
    Hier mal was was nur ein gui hat und auch die uhr anzeigt^^
    schön machen musst du, weil ich auch noch nicht viel mit GDI gemacht hab xD
    ich hab mal damits einfacher wird für mich die dreiecke rausgenommen^^
    Es ist gewiss nicht die beste lösung aber schon ein Schritt in die richtige richtung ;)
    mal schaun was du daraus machst xD

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Include <Date.au3>
    #include <GDIPlus.au3>

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

    HotKeySet("{ESC}", "ende")
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("", 1000,250, 602, 5,$WS_POPUP)
    GUISetState()
    ;~ $Form11 = GUICreate("", 100,250,1062, 5,$WS_POPUP)
    ;~ GUISetState()
    ;~ $Form2 = GUICreate("", 100,250, 940, 5,$WS_POPUP)
    ;~ GUISetState()
    ;~ $Form21 = GUICreate("", 100,250,832, 5,$WS_POPUP)
    ;~ GUISetState()
    ;~ $Form3 = GUICreate("", 100,250, 710, 5,$WS_POPUP)
    ;~ GUISetState()
    ;~ $Form31 = GUICreate("", 100,250,602, 5,$WS_POPUP)
    ;~ GUISetState()
    #EndRegion ### END Koda GUI section ###

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

    #region Declaration
    Global $hoch=100
    Global $breit=40
    Global $x =910
    Global $x1=980
    $x2=110
    $x3=80
    $x4=210
    Global $y =20
    $y2=120
    $y4=220
    Global $ziffer[10]
    $ziffer[1]="0.0.1.1.0.0.0.0.0.0.0.1.1.1.1.0.0.0.0.0.0"
    $ziffer[2]="1.0.0.1.1.1.1.0.0.1.1.1.1.0.0.1.1.1.1.1.1"
    $ziffer[3]="0.0.1.1.1.1.1.0.0.0.0.1.1.1.1.1.1.1.1.1.1"
    $ziffer[4]="0.1.1.1.0.1.0.1.1.0.0.1.1.1.1.0.0.1.1.0.0"
    $ziffer[5]="0.1.1.0.1.1.1.1.1.0.0.0.0.1.1.1.1.1.1.1.1"
    $ziffer[6]="1.1.1.0.0.1.1.1.1.1.1.0.0.1.1.0.0.1.1.1.1"
    $ziffer[7]="0.0.1.1.1.0.0.0.0.0.0.1.1.1.1.1.1.0.0.0.0"
    $ziffer[8]="1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1"
    $ziffer[9]="0.1.1.1.1.1.0.1.1.0.0.1.1.1.1.1.1.1.1.0.0"
    $ziffer[0]="1.1.1.1.1.0.1.1.1.1.1.1.1.1.1.1.1.0.0.1.1"

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

    dim $dreieck[4][2]
    dim $dreieck1[4][2]
    dim $dreieck2[4][2]
    dim $dreieck3[4][2]
    dim $dreieck4[4][2]
    dim $dreieck5[4][2]
    dim $dreieck6[4][2]
    dim $dreieck7[4][2]
    dim $dreieck8[4][2]
    dim $dreieck9[4][2]
    dim $dreieck10[4][2]
    dim $dreieck11[4][2]
    dim $dreieck12[4][2]
    dim $dreieck13[4][2]
    $d =$x &": "&$y &":"&$x+10 &":"&$y &":" &$x+5 &":"&$y-5
    $d1=$x &":" &$y2 &":"&$x+10 &":"&$y2 &":" &$x+5 &":"&$y2+5
    $d2=$x &":" &$y2+10 &":"&$x+10 &":"&$y2+10 &":" &$x+5 &":"&$y2+5
    $d3=$x &":" &$y4+10 &":"&$x+10 &":"&$y4+10 &":" &$x+5 &":"&$y4+15
    $d4=$x3 &":" &$y &":"&$x3+10 &":"&$y &":" &$x3+5 &":"&$y-5
    $d5=$x3 &":" &$y2 &":"&$x3+10 &":"&$y2 &":" &$x3+5 &":"&$y2+5
    $d6=$x3 &":" &$y2+10 &":"&$x3+10 &":"&$y2+10 &":" &$x3+5 &":"&$y2+5
    $d7=$x3 &":" &$y4+10 &":"&$x3+10 &":"&$y4+10 &":" &$x3+5 &":"&$y4+15
    $d8=$x+10 &": "&$y-5 &":"&$x+20 &":"&$y-10 &":" &$x+20 &":"&$y
    $d9=$x+70 &": "&$y-5 &":"&$x+60 &":"&$y-10 &":" &$x+60 &":"&$y
    $d10=$x+10 &": "&$y2+5 &":"&$x+20 &":"&$y2 &":" &$x+20 &":"&$y2+10
    $d11=$x+70 &": "&$y2+5 &":"&$x+60 &":"&$y2 &":" &$x+60 &":"&$y2+10
    $d12=$x+10 &": "&$y4+15 &":"&$x+20 &":"&$y4+10 &":" &$x+20 &":"&$y4+20
    $d13=$x+70 &": "&$y4+15 &":"&$x+60 &":"&$y4+10 &":" &$x+60 &":"&$y4+20
    arrayfill($dreieck,$d)
    arrayfill($dreieck1,$d1)
    arrayfill($dreieck2,$d2)
    arrayfill($dreieck3,$d3)
    arrayfill($dreieck4,$d4)
    arrayfill($dreieck5,$d5)
    arrayfill($dreieck6,$d6)
    arrayfill($dreieck7,$d7)
    arrayfill($dreieck8,$d8)
    arrayfill($dreieck9,$d9)
    arrayfill($dreieck10,$d10)
    arrayfill($dreieck11,$d11)
    arrayfill($dreieck12,$d12)
    arrayfill($dreieck13,$d13)
    #endregion

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

    _GDIPlus_Startup()
    $grafik=_GDIPlus_GraphicsCreateFromHWND($Form1)
    ;~ $grafik1=_GDIPlus_GraphicsCreateFromHWND($Form11)
    ;~ $grafik2=_GDIPlus_GraphicsCreateFromHWND($Form2)
    ;~ $grafik3=_GDIPlus_GraphicsCreateFromHWND($Form21)
    ;~ $grafik4=_GDIPlus_GraphicsCreateFromHWND($Form3)
    ;~ $grafik5=_GDIPlus_GraphicsCreateFromHWND($Form31)
    Global $Brush = _GDIPlus_BrushCreateSolid(0xff00bb00)
    _GDIPlus_GraphicsClear($grafik,0x00ffffff)
    ;~ _GDIPlus_GraphicsClear($grafik1,0x00ffffff)
    ;~ _GDIPlus_GraphicsClear($grafik2,0x00ffffff)
    ;~ _GDIPlus_GraphicsClear($grafik3,0x00ffffff)
    ;~ _GDIPlus_GraphicsClear($grafik4,0x00ffffff)
    ;~ _GDIPlus_GraphicsClear($grafik5,0x00ffffff)

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

    While 1

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

    ziffer($grafik)
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    Sleep(1000)
    _GDIPlus_GraphicsClear($grafik,0x00ffffff)
    WEnd

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

    func ziffer($gra)
    $uhr=_NowTime(5)
    $zeit=StringSplit($uhr,":")
    $b=stringright($zeit[3],1)
    $c=stringleft($zeit[3],1)
    $e=stringright($zeit[2],1)
    $f=stringleft($zeit[2],1)
    $g=stringright($zeit[1],1)
    $h=stringleft($zeit[1],1)

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

    _1($b, $gra)
    _1($c, $gra, -100)
    _1($e, $gra, -300)
    _1($f, $gra, -400)
    _1($g, $gra, -600)
    _1($h, $gra, -700)

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

    EndFunc

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

    func _1($b,$grafik, $xDiff = 0)

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

    $teil=StringSplit($ziffer[$b],".")

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

    if $teil[1]=1 then $strichsenkrecht1=_GDIPlus_GraphicsfillRect($grafik,$x + $xDiff,$y2+10,10,$hoch,$Brush)
    if $teil[2]=1 then $strichsenkrecht2=_GDIPlus_GraphicsfillRect($grafik,$x + $xDiff,$y,10,$hoch,$Brush)
    if $teil[3]=1 then $strichsenkrecht3=_GDIPlus_GraphicsfillRect($grafik,$x1 + $xDiff,$y2+10,10,$hoch,$Brush)
    if $teil[4]=1 then $strichsenkrecht4=_GDIPlus_GraphicsfillRect($grafik,$x1 + $xDiff,$y,10,$hoch,$Brush)

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

    if $teil[5]=1 then $strichwaagerecht1=_GDIPlus_GraphicsfillRect($grafik,$x + $xDiff+20,$y-10,$breit,10,$Brush)
    if $teil[6]=1 then $strichwaagerecht2=_GDIPlus_GraphicsfillRect($grafik,$x + $xDiff+20,$y2,$breit,10,$Brush)
    if $teil[7]=1 then $strichwaagerecht3=_GDIPlus_GraphicsfillRect($grafik,$x + $xDiff+20,$y4+10,$breit,10,$Brush)

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

    ;~ if $teil[8]=1 then $dreiecksenkrecht1=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck,$Brush)
    ;~ if $teil[9]=1 then $dreiecksenkrecht2=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck1,$Brush)
    ;~ if $teil[10]=1 then $dreiecksenkrecht3=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck2,$Brush)
    ;~ if $teil[11]=1 then $dreiecksenkrecht4=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck3,$Brush)

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

    ;~ if $teil[12]=1 then $dreiecksenkrecht5=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck4,$Brush)
    ;~ if $teil[13]=1 then $dreiecksenkrecht6=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck5,$Brush)
    ;~ if $teil[14]=1 then $dreiecksenkrecht7=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck6,$Brush)
    ;~ if $teil[15]=1 then $dreiecksenkrecht8=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck7,$Brush)

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

    ;~ if $teil[16]=1 then $dreieckwaagerecht1=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck8,$Brush)
    ;~ if $teil[17]=1 then $dreieckwaagerecht2=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck9,$Brush)
    ;~ if $teil[18]=1 then $dreieckwaagerecht3=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck10,$Brush)
    ;~ if $teil[19]=1 then $dreieckwaagerecht4=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck11,$Brush)
    ;~ if $teil[20]=1 then $dreieckwaagerecht5=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck12,$Brush)
    ;~ if $teil[21]=1 then $dreieckwaagerecht6=_GDIPlus_GraphicsFillPolygon($grafik,$dreieck13,$Brush)
    EndFunc

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

    func arrayfill(byref $dreieck,$coords)
    $a2=StringSplit($coords,":")
    $1=1
    $2=0
    for $q=1 to 6
    $dreieck[0][0]=3
    $dreieck[$1][$2]=$a2[$q]
    if $2=0 then
    $2=1
    else
    $2=0
    $1+=1
    EndIf
    Next
    return $dreieck
    EndFunc

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

    func ende()
    _GDIPlus_GraphicsDispose($grafik)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

    [/autoit]

    2 Mal editiert, zuletzt von Kijan (11. September 2010 um 00:28)

  • Hallo,

    nett gemacht. Das Ganze wäre sicherlich "ruhiger", wenn Du die Bitmaps für die 10 Ziffern nur einmal erstellst und sie dann bei Bedarf per

    [autoit]

    Global Const $STM_SETIMAGE = 0x172
    Global Const $IMAGE_BITMAP = 0x0

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

    GUICtrlSendMsg($idPic, $STM_SETIMAGE, $IMAGE_BITMAP, $HBITMAP)

    [/autoit]

    passenden Pic-Controls zuweist.

  • kannst du mir die Funktionsweise dieser Messagesendung mal erklären (sorry,absoluter Rookie) und speziell die Hex-werte und wie mann darauf kommt???


    BTW bin grad am überarbeiten des skriptes,versuch jetzt schon seit über 2 stunden,2D Arrays in einer schleife mit der zählervariable zu dimensionieren---->>> no way

    so ungefähr

    Spoiler anzeigen
    [autoit]


    for $array=1 to 24
    $array="$array"&$array
    dim $array[7][2]
    Next

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

    in die Arrays kommen die Koordinaten für die Segmentpolygone---> mit Offset in x und y richtung,um das alles in einer gui darzustellen
    Also offsetbefüllung der Arrays klappt ,habs mit _ArrayDisplay($array,$array) getestet
    ABER bei der Zuordnung der Variablennamen der Arrays hakt es,kann sie später nicht abfragen und:

    Spoiler anzeigen
    [autoit]


    for $array=1 to 24
    _GDIPlus_GraphicsFillPolygon($grafik,$array,$Brush)
    next

    [/autoit]


    zuordnen

    Einmal editiert, zuletzt von TAFFY (11. September 2010 um 12:46)

  • ich raff grad nich was du das veruschst mit der schleife^^

    wenn du nen 2d array in ner schleife zuweisen willst dann ungefähr so:

    Spoiler anzeigen
    [autoit]


    Dim $array[24][5]
    For $i = 0 To UBound($array)-1
    For $j = 0 To UBound($array,2)-1
    $array[$i][$j] = "Wert"
    Next
    Next

    [/autoit]

    wenn du dann dein Array weiter benutzen willst musst das ungefähr so machen:

    Spoiler anzeigen
    [autoit]

    for $k=0 to 23
    _GDIPlus_GraphicsFillPolygon($grafik,$array[$k][0],$Brush)
    next

    [/autoit]

    Schau dir vllt auch noch diesen Link an besonders den Teil mit Array^^

  • Ne zuweisung der Arraywerte ist kein problem
    ich brauch 24 arrays([][]) und will den Variablennamen der jeweiligen arrays bei der erstellung in einer Schleife erledigen
    ........................../\___________________________________________/\

  • Zitat von TAFFY

    kannst du mir die Funktionsweise dieser Messagesendung mal erklären (sorry,absoluter Rookie) und speziell die Hex-werte und wie mann darauf kommt???


    Ich habe jetzt keine Zeit mehr, kann aber soviel sagen: Es handelt sich um eine Windows-Nachricht (Message), die ein "statisches" (Pic)-Control veranlasst, die übergebene Bitmap anzuzeigen.

    Was ich meinte, zeigt der folgende Code:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Date.au3>
    #include <GDIPlus.au3>

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

    HotKeySet("{ESC}", "Ende")
    OnAutoItExitRegister("Ende")

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

    #region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("", 620, 250, 600, 5, $WS_POPUP, $WS_EX_LAYERED)
    GUISetBkColor(0xFFFFFF)
    $H1 = GUICtrlCreatePic("", 0, 0, 100, 250, -1, $GUI_WS_EX_PARENTDRAG)
    $H2 = GUICtrlCreatePic("", 100, 0, 100, 250, -1, $GUI_WS_EX_PARENTDRAG)
    $M1 = GUICtrlCreatePic("", 210, 0, 100, 250, -1, $GUI_WS_EX_PARENTDRAG)
    $M2 = GUICtrlCreatePic("", 310, 0, 100, 250, -1, $GUI_WS_EX_PARENTDRAG)
    $S1 = GUICtrlCreatePic("", 420, 0, 100, 250, -1, $GUI_WS_EX_PARENTDRAG)
    $S2 = GUICtrlCreatePic("", 520, 0, 100, 250, -1, $GUI_WS_EX_PARENTDRAG)
    #endregion ### END Koda GUI section ###

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

    #region Declaration
    Global Const $STM_SETIMAGE = 0x172
    Global Const $IMAGE_BITMAP = 0x0

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

    Global $hoch = 100
    Global $breit = 40
    Global $x = 10
    Global $x1 = 80
    $x2 = 110
    $x3 = 80
    $x4 = 210
    Global $y = 20
    $y2 = 120
    $y4 = 220
    Dim $ziffer[10]
    $ziffer[0] = "1.1.1.1.1.0.1.1.1.1.1.1.1.1.1.1.1.0.0.1.1"
    $ziffer[1] = "0.0.1.1.0.0.0.0.0.0.0.1.1.1.1.0.0.0.0.0.0"
    $ziffer[2] = "1.0.0.1.1.1.1.0.0.1.1.1.1.0.0.1.1.1.1.1.1"
    $ziffer[3] = "0.0.1.1.1.1.1.0.0.0.0.1.1.1.1.1.1.1.1.1.1"
    $ziffer[4] = "0.1.1.1.0.1.0.1.1.0.0.1.1.1.1.0.0.1.1.0.0"
    $ziffer[5] = "0.1.1.0.1.1.1.1.1.0.0.0.0.1.1.1.1.1.1.1.1"
    $ziffer[6] = "1.1.1.0.0.1.1.1.1.1.1.0.0.1.1.0.0.1.1.1.1"
    $ziffer[7] = "0.0.1.1.1.0.0.0.0.0.0.1.1.1.1.1.1.0.0.0.0"
    $ziffer[8] = "1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1"
    $ziffer[9] = "0.1.1.1.1.1.0.1.1.0.0.1.1.1.1.1.1.1.1.0.0"

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

    Dim $dreieck[4][2]
    Dim $dreieck1[4][2]
    Dim $dreieck2[4][2]
    Dim $dreieck3[4][2]
    Dim $dreieck4[4][2]
    Dim $dreieck5[4][2]
    Dim $dreieck6[4][2]
    Dim $dreieck7[4][2]
    Dim $dreieck8[4][2]
    Dim $dreieck9[4][2]
    Dim $dreieck10[4][2]
    Dim $dreieck11[4][2]
    Dim $dreieck12[4][2]
    Dim $dreieck13[4][2]
    $d = $x & ": " & $y & ":" & $x + 10 & ":" & $y & ":" & $x + 5 & ":" & $y - 5
    $d1 = $x & ":" & $y2 & ":" & $x + 10 & ":" & $y2 & ":" & $x + 5 & ":" & $y2 + 5
    $d2 = $x & ":" & $y2 + 10 & ":" & $x + 10 & ":" & $y2 + 10 & ":" & $x + 5 & ":" & $y2 + 5
    $d3 = $x & ":" & $y4 + 10 & ":" & $x + 10 & ":" & $y4 + 10 & ":" & $x + 5 & ":" & $y4 + 15
    $d4 = $x3 & ":" & $y & ":" & $x3 + 10 & ":" & $y & ":" & $x3 + 5 & ":" & $y - 5
    $d5 = $x3 & ":" & $y2 & ":" & $x3 + 10 & ":" & $y2 & ":" & $x3 + 5 & ":" & $y2 + 5
    $d6 = $x3 & ":" & $y2 + 10 & ":" & $x3 + 10 & ":" & $y2 + 10 & ":" & $x3 + 5 & ":" & $y2 + 5
    $d7 = $x3 & ":" & $y4 + 10 & ":" & $x3 + 10 & ":" & $y4 + 10 & ":" & $x3 + 5 & ":" & $y4 + 15
    $d8 = $x + 10 & ": " & $y - 5 & ":" & $x + 20 & ":" & $y - 10 & ":" & $x + 20 & ":" & $y
    $d9 = $x + 70 & ": " & $y - 5 & ":" & $x + 60 & ":" & $y - 10 & ":" & $x + 60 & ":" & $y
    $d10 = $x + 10 & ": " & $y2 + 5 & ":" & $x + 20 & ":" & $y2 & ":" & $x + 20 & ":" & $y2 + 10
    $d11 = $x + 70 & ": " & $y2 + 5 & ":" & $x + 60 & ":" & $y2 & ":" & $x + 60 & ":" & $y2 + 10
    $d12 = $x + 10 & ": " & $y4 + 15 & ":" & $x + 20 & ":" & $y4 + 10 & ":" & $x + 20 & ":" & $y4 + 20
    $d13 = $x + 70 & ": " & $y4 + 15 & ":" & $x + 60 & ":" & $y4 + 10 & ":" & $x + 60 & ":" & $y4 + 20
    ArrayFill($dreieck, $d)
    ArrayFill($dreieck1, $d1)
    ArrayFill($dreieck2, $d2)
    ArrayFill($dreieck3, $d3)
    ArrayFill($dreieck4, $d4)
    ArrayFill($dreieck5, $d5)
    ArrayFill($dreieck6, $d6)
    ArrayFill($dreieck7, $d7)
    ArrayFill($dreieck8, $d8)
    ArrayFill($dreieck9, $d9)
    ArrayFill($dreieck10, $d10)
    ArrayFill($dreieck11, $d11)
    ArrayFill($dreieck12, $d12)
    ArrayFill($dreieck13, $d13)
    #endregion Declaration

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

    #region GDIPLUS
    _GDIPlus_Startup()
    $Brush = _GDIPlus_BrushCreateSolid(0xFF00FF00)
    ; GDIPlus-Bitmap erstellen
    $aResult = DllCall($ghGDIPDll, "Int", "GdipCreateBitmapFromScan0", "Int", 100, "Int", 250, "Int", 0, "Int", 0x26200A, "Ptr", 0, "Ptr*", 0)
    $hPBitmap = $aResult[6]
    ; Pointer auf den Grafikkontext holen
    $Graphics = _GDIPlus_ImageGetGraphicsContext($hPBitmap)
    ; Zahlen von 0 bis 10 erstellen
    Dim $aHBITMAP[10]
    For $I = 0 To 9
    $aHBITMAP[$I] = _1($ziffer[$I], $Graphics)
    Next
    _GDIPlus_GraphicsClear($Graphics)
    _GDIPlus_ImageDispose($hPBitmap)
    _GDIPlus_BrushDispose($Brush)
    _GDIPlus_GraphicsDispose($Graphics)
    ; Shutdown GDI+
    _GDIPlus_Shutdown()
    #endregion GDIPLUS

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

    $SEC = ""
    $MIN = ""
    $HOUR = ""
    _WinAPI_SetLayeredWindowAttributes($Form1, 0xFFFFFF, 120)
    GUISetState()

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

    While GUIGetMsg() <> $GUI_EVENT_CLOSE
    If $SEC <> @SEC Then
    GUICtrlSendMsg($S2, $STM_SETIMAGE, $IMAGE_BITMAP, $aHBITMAP[StringRight(@SEC, 1)])
    If StringLeft(@SEC, 1) <> StringLeft($SEC, 1) Then
    GUICtrlSendMsg($S1, $STM_SETIMAGE, $IMAGE_BITMAP, $aHBITMAP[StringLeft(@SEC, 1)])
    EndIf
    $SEC = @SEC
    If $MIN <> @MIN Then
    GUICtrlSendMsg($M2, $STM_SETIMAGE, $IMAGE_BITMAP, $aHBITMAP[StringRight(@MIN, 1)])
    If StringLeft(@MIN, 1) <> StringLeft($MIN, 1) Then
    GUICtrlSendMsg($M1, $STM_SETIMAGE, $IMAGE_BITMAP, $aHBITMAP[StringLeft(@MIN, 1)])
    EndIf
    $MIN = @MIN
    EndIf
    If $HOUR <> @HOUR Then
    GUICtrlSendMsg($H2, $STM_SETIMAGE, $IMAGE_BITMAP, $aHBITMAP[StringRight(@HOUR, 1)])
    If StringLeft(@HOUR, 1) <> StringLeft($HOUR, 1) Then
    GUICtrlSendMsg($H1, $STM_SETIMAGE, $IMAGE_BITMAP, $aHBITMAP[StringLeft(@HOUR, 1)])
    EndIf
    $HOUR = @HOUR
    EndIf
    EndIf
    WEnd

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

    Exit

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

    Func _1(ByRef $ziffer, $grafik)
    _GDIPlus_GraphicsClear($grafik)
    $teil = StringSplit($ziffer, ".")
    If $teil[1] = 1 Then $strichsenkrecht1 = _GDIPlus_GraphicsFillRect($grafik, $x, $y2 + 10, 10, $hoch, $Brush)
    If $teil[2] = 1 Then $strichsenkrecht2 = _GDIPlus_GraphicsFillRect($grafik, $x, $y, 10, $hoch, $Brush)
    If $teil[3] = 1 Then $strichsenkrecht3 = _GDIPlus_GraphicsFillRect($grafik, $x1, $y2 + 10, 10, $hoch, $Brush)
    If $teil[4] = 1 Then $strichsenkrecht4 = _GDIPlus_GraphicsFillRect($grafik, $x1, $y, 10, $hoch, $Brush)

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

    If $teil[5] = 1 Then $strichwaagerecht1 = _GDIPlus_GraphicsFillRect($grafik, $x + 20, $y - 10, $breit, 10, $Brush)
    If $teil[6] = 1 Then $strichwaagerecht2 = _GDIPlus_GraphicsFillRect($grafik, $x + 20, $y2, $breit, 10, $Brush)
    If $teil[7] = 1 Then $strichwaagerecht3 = _GDIPlus_GraphicsFillRect($grafik, $x + 20, $y4 + 10, $breit, 10, $Brush)

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

    If $teil[8] = 1 Then $dreiecksenkrecht1 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck, $Brush)
    If $teil[9] = 1 Then $dreiecksenkrecht2 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck1, $Brush)
    If $teil[10] = 1 Then $dreiecksenkrecht3 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck2, $Brush)
    If $teil[11] = 1 Then $dreiecksenkrecht4 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck3, $Brush)

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

    If $teil[12] = 1 Then $dreiecksenkrecht5 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck4, $Brush)
    If $teil[13] = 1 Then $dreiecksenkrecht6 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck5, $Brush)
    If $teil[14] = 1 Then $dreiecksenkrecht7 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck6, $Brush)
    If $teil[15] = 1 Then $dreiecksenkrecht8 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck7, $Brush)

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

    If $teil[16] = 1 Then $dreieckwaagerecht1 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck8, $Brush)
    If $teil[17] = 1 Then $dreieckwaagerecht2 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck9, $Brush)
    If $teil[18] = 1 Then $dreieckwaagerecht3 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck10, $Brush)
    If $teil[19] = 1 Then $dreieckwaagerecht4 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck11, $Brush)
    If $teil[20] = 1 Then $dreieckwaagerecht5 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck12, $Brush)
    If $teil[21] = 1 Then $dreieckwaagerecht6 = _GDIPlus_GraphicsFillPolygon($grafik, $dreieck13, $Brush)

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

    ; HBITMAP für die Bitmap erzeugen
    Return _GDIPlus_BitmapCreateHBITMAPFromBitmap($hPBitmap)
    EndFunc ;==>_1

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

    Func ArrayFill(ByRef $dreieck, $coords)
    $a2 = StringSplit($coords, ":")
    $1 = 1
    $2 = 0
    For $q = 1 To 6
    $dreieck[0][0] = 3
    $dreieck[$1][$2] = $a2[$q]
    If $2 = 0 Then
    $2 = 1
    Else
    $2 = 0
    $1 += 1
    EndIf
    Next
    Return $dreieck
    EndFunc ;==>ArrayFill

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

    Func Ende()
    For $I = 0 To 9
    _WinAPI_DeleteObject($aHBITMAP[$I])
    Next
    Exit
    EndFunc ;==>Ende

    [/autoit]
  • So jetzt isses erst mal lauffähig
    hoffe auf verbesserungsvorschläge ( versucht mal rechtsklick auf die Uhr-->> ist zur zeit meine baustelle---<<< Anregungen unbedingt erwünscht

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Include <Array.au3>
    #include <GDIPlus.au3>
    #Include <Date.au3>
    #Include <String.au3>
    #region
    HotKeySet("{ESC}", "ende")
    Local $offset1=0,$offset2=0,$neu="",$senkrecht="50,10,55,15,55,95,50,100,45,95,45,15",$waagerecht="55,10,60,5,100,5,105,10,100,15,60,15"
    Global $array[43],$wo[7],$wo2[7][8],$segmentort1[7][8],$array2[7][2],$array3[7][2],$ziffer[7],$trans=255
    $ziffer[1]="1,2,13,14,25,31,37"
    $ziffer[2]="3,4,15,16,26,32,38"
    $ziffer[3]="5,6,17,18,27,33,39"
    $ziffer[4]="7,8,19,20,28,34,40"
    $ziffer[5]="9,10,21,22,29,35,41"
    $ziffer[6]="11,12,23,24,30,36,42"
    for $a=1 to 24
    $teil=StringSplit($senkrecht,",")
    for $teil1=1 to 11 step 2
    $teil[$teil1]=$teil[$teil1]+$offset1
    next
    for $teil1=2 to 12 step 2
    $teil[$teil1]=$teil[$teil1]+$offset2
    next
    for $teil1=1 to 12
    $neu=$neu&$teil[$teil1]&","
    Next
    $neu=StringTrimRight($neu,1)
    $array[$a]=$neu
    $offset1+=60
    $neu=""
    if $a=12 then
    $offset1=0
    $offset2=90
    EndIf
    Next
    Local $offset1=0,$offset2=0
    for $a=25 to 42
    $teil=StringSplit($waagerecht,",")
    for $teil1=1 to 11 step 2
    $teil[$teil1]=$teil[$teil1]+$offset1
    next
    for $teil1=2 to 12 step 2
    $teil[$teil1]=$teil[$teil1]+$offset2
    next
    for $teil1=1 to 12
    $neu=$neu&$teil[$teil1]&","
    Next
    $neu=StringTrimRight($neu,1)
    $array[$a]=$neu
    $offset1+=120
    $neu=""
    if $a=30 then
    $offset1=0
    $offset2=90
    EndIf
    if $a=36 then
    $offset1=0
    $offset2=180
    EndIf
    Next
    #endregion

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

    #region
    $Form1 = GUICreate("1", 800,200, 100, 205,$WS_POPUP)
    GUISetBkColor(0x000000)

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

    GUISetState()
    _GDIPlus_Startup()
    Global $grafik=_GDIPlus_GraphicsCreateFromHWND($Form1)
    Global $Brush = _GDIPlus_BrushCreateSolid(0xff00bb00)
    Global $Brush1 = _GDIPlus_BrushCreateSolid(0xFF000000)
    #endregion

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

    While 1

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

    $nMsg = GUIGetMsg()
    $maus=GUIGetCursorInfo ($Form1)
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_GraphicsDispose($grafik)
    _GDIPlus_Shutdown()
    Exit
    EndSwitch
    Select
    case $maus[3]=1
    if not WinExists("2","") then optionen()
    EndSelect
    uhrzeit()
    WEnd

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

    func optionen()
    $Form2 = GUICreate("2", 800,50, 100, 405,$WS_POPUP)
    GUISetBkColor(0xFFFFFF)
    $exitbutton=GUICtrlCreateButton("Fertig",750,10,40,30)
    $transslider=GUICtrlCreateSlider(10,10,150,30)
    GUICtrlSetBkColor(-1,0xFFFFFF)
    GUICtrlSetLimit(-1, 250,0)
    GUISetState()
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $exitbutton
    GUIDelete($Form2)
    ExitLoop
    case $transslider
    $trans=GUICtrlRead($transslider)
    GUISetBkColor(RGB2BGR($trans),$Form1)
    _GDIPlus_BrushSetSolidColor($Brush1,_StringInsert(RGB2BGR($trans),"FF",2))
    EndSwitch
    WEnd
    EndFunc

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

    Func uhrzeit()
    $uhr=_NowTime(5)
    $zeit=StringSplit($uhr,":")
    $St1 =StringLeft ($zeit[1],1)
    $St2 =StringRight($zeit[1],1)
    $Min1=StringLeft ($zeit[2],1)
    $Min2=StringRight($zeit[2],1)
    $Sek1=StringLeft ($zeit[3],1)
    $Sek2=StringRight($zeit[3],1)
    ziffer($St1,1)
    ziffer($St2,2)
    ziffer($Min1,3)
    ziffer($Min2,4)
    ziffer($Sek1,5)
    ziffer($Sek2,6)
    $Stunde1 =StringSplit($ziffer[1],",")
    $Stunde2 =StringSplit($ziffer[2],",")
    $Minute1 =StringSplit($ziffer[3],",")
    $Minute2 =StringSplit($ziffer[4],",")
    $Sekunde1=StringSplit($ziffer[5],",")
    $Sekunde2=StringSplit($ziffer[6],",")
    $wo[0]=$uhr
    for $a = 1 to 6
    for $b=1 to 7
    $segmentort=StringSplit($ziffer[$a],",")
    $wo1=StringSplit($wo[$a],",")
    $wo2[$a][$b]=$wo1[$b]
    if $wo2[$a][$b]=1 then
    $segmentort1[$a][$b]="1|"&$segmentort[$b]
    Else
    $segmentort1[$a][$b]="0|"&$segmentort[$b]
    EndIf
    Next
    Next
    segment()
    EndFunc

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

    func ziffer(ByRef $zeit,$segment)
    Select
    case $zeit="0"
    $wo[$segment]="1,1,1,1,1,0,1"
    case $zeit="1"
    $wo[$segment]="0,1,0,1,0,0,0"
    case $zeit="2"
    $wo[$segment]="0,1,1,0,1,1,1"
    case $zeit="3"
    $wo[$segment]="0,1,0,1,1,1,1"
    case $zeit="4"
    $wo[$segment]="1,1,0,1,0,1,0"
    case $zeit="5"
    $wo[$segment]="1,0,0,1,1,1,1"
    case $zeit="6"
    $wo[$segment]="1,0,1,1,1,1,1"
    case $zeit="7"
    $wo[$segment]="0,1,0,1,1,0,0"
    case $zeit="8"
    $wo[$segment]="1,1,1,1,1,1,1"
    case $zeit="9"
    $wo[$segment]="1,1,0,1,1,1,0"
    EndSelect
    return $wo
    EndFunc

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

    Func segment()
    Local $px1=250,$px2=495,$ww=""
    _GDIPlus_GraphicsFillEllipse($grafik,$px1,60, 15, 15,$Brush1)
    _GDIPlus_GraphicsFillEllipse($grafik,$px1,120, 15, 15,$Brush1)
    _GDIPlus_GraphicsFillEllipse($grafik,$px2,60, 15, 15,$Brush1)
    _GDIPlus_GraphicsFillEllipse($grafik,$px2,120, 15, 15,$Brush1)
    Sleep(500)
    for $a = 1 to 6
    For $b=1 to 7
    $ww=$ww&$segmentort1[$a][$b]&","
    Next
    Next
    $ww1=StringSplit($ww,",")
    for $a=1 to 42
    if StringLeft($ww1[$a],1)="1" then
    $senkrecht1=StringSplit($array[StringTrimLeft($ww1[$a],2)],",")
    $array2[0][0]=6
    $array2[1][0]=$senkrecht1[1]
    $array2[1][1]=$senkrecht1[2]
    $array2[2][0]=$senkrecht1[3]
    $array2[2][1]=$senkrecht1[4]
    $array2[3][0]=$senkrecht1[5]
    $array2[3][1]=$senkrecht1[6]
    $array2[4][0]=$senkrecht1[7]
    $array2[4][1]=$senkrecht1[8]
    $array2[5][0]=$senkrecht1[9]
    $array2[5][1]=$senkrecht1[10]
    $array2[6][0]=$senkrecht1[11]
    $array2[6][1]=$senkrecht1[12]
    _GDIPlus_GraphicsFillPolygon($grafik,$array2,$Brush)
    Else
    $senkrecht1=StringSplit($array[StringTrimLeft($ww1[$a],2)],",")
    $array2[0][0]=6
    $array2[1][0]=$senkrecht1[1]
    $array2[1][1]=$senkrecht1[2]
    $array2[2][0]=$senkrecht1[3]
    $array2[2][1]=$senkrecht1[4]
    $array2[3][0]=$senkrecht1[5]
    $array2[3][1]=$senkrecht1[6]
    $array2[4][0]=$senkrecht1[7]
    $array2[4][1]=$senkrecht1[8]
    $array2[5][0]=$senkrecht1[9]
    $array2[5][1]=$senkrecht1[10]
    $array2[6][0]=$senkrecht1[11]
    $array2[6][1]=$senkrecht1[12]
    _GDIPlus_GraphicsFillPolygon($grafik,$array2,$Brush1)
    EndIf
    Next
    _GDIPlus_GraphicsFillEllipse($grafik,$px1,60, 15, 15,$Brush)
    _GDIPlus_GraphicsFillEllipse($grafik,$px1,120, 15, 15,$Brush)
    _GDIPlus_GraphicsFillEllipse($grafik,$px2,60, 15, 15,$Brush)
    _GDIPlus_GraphicsFillEllipse($grafik,$px2,120, 15, 15,$Brush)
    sleep(500)
    EndFunc

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

    func ende()
    _GDIPlus_GraphicsDispose($grafik)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

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

    Func RGB2BGR($iColor)
    Local $sH = Hex($iColor,6)
    Return '0x' & StringRight($sH, 2) & StringMid($sH,3,2) & StringLeft($sH, 2)
    EndFunc

    [/autoit]

    wenn ich euch damit nerve,sagt bescheid,dann schließe ich dasThema

  • Hier gabs mal einen Thread zu diesem Thema, der Link geht zu meinem Beitrag, der das ganze ohne 3D-Array löst^^
    Transparent hatte ich das alles auch, waren allerdings einige Zeilen mehr...

  • Hallo,

    meine Anregungen:

    • Deinen GUIs würde der GUIOnEventMode guttun, weil dann Alles unabhängig voneinander laufen kann.
    • Deine zwei Sleep(500) in segment() bewirken, dass die Routine zwingend länger als 1 Sekunde läuft. Dir gehen deshalb ab und zu Sekunden verloren. Das Neuzeichnen muss nur beim Wechsel der Sekunde genmacht werden, dann reicht unten auch ein kürzerer Sleep.
    • Ich ziehe es vor, die GUIs nur einmal zu erstellen und dann bei Bedarf ein- bzw. auszublenden. Das ist aber Sache des persönlichen Geschmacks.
    Dein Skript mit ein paar Anpassungen:
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <Array.au3>
    #include <GDIPlus.au3>
    #include <Date.au3>
    #include <String.au3>
    #region
    HotKeySet("{ESC}", "ende")
    Local $offset1 = 0, $offset2 = 0, $neu = "", $senkrecht = "50,10,55,15,55,95,50,100,45,95,45,15", $waagerecht = "55,10,60,5,100,5,105,10,100,15,60,15"
    Global $array[43], $wo[7], $wo2[7][8], $segmentort1[7][8], $array2[7][2], $array3[7][2], $ziffer[7], $trans = 255
    $ziffer[1] = "1,2,13,14,25,31,37"
    $ziffer[2] = "3,4,15,16,26,32,38"
    $ziffer[3] = "5,6,17,18,27,33,39"
    $ziffer[4] = "7,8,19,20,28,34,40"
    $ziffer[5] = "9,10,21,22,29,35,41"
    $ziffer[6] = "11,12,23,24,30,36,42"
    For $a = 1 To 24
    $teil = StringSplit($senkrecht, ",")
    For $teil1 = 1 To 11 Step 2
    $teil[$teil1] = $teil[$teil1] + $offset1
    Next
    For $teil1 = 2 To 12 Step 2
    $teil[$teil1] = $teil[$teil1] + $offset2
    Next
    For $teil1 = 1 To 12
    $neu = $neu & $teil[$teil1] & ","
    Next
    $neu = StringTrimRight($neu, 1)
    $array[$a] = $neu
    $offset1 += 60
    $neu = ""
    If $a = 12 Then
    $offset1 = 0
    $offset2 = 90
    EndIf
    Next
    Local $offset1 = 0, $offset2 = 0
    For $a = 25 To 42
    $teil = StringSplit($waagerecht, ",")
    For $teil1 = 1 To 11 Step 2
    $teil[$teil1] = $teil[$teil1] + $offset1
    Next
    For $teil1 = 2 To 12 Step 2
    $teil[$teil1] = $teil[$teil1] + $offset2
    Next
    For $teil1 = 1 To 12
    $neu = $neu & $teil[$teil1] & ","
    Next
    $neu = StringTrimRight($neu, 1)
    $array[$a] = $neu
    $offset1 += 120
    $neu = ""
    If $a = 30 Then
    $offset1 = 0
    $offset2 = 90
    EndIf
    If $a = 36 Then
    $offset1 = 0
    $offset2 = 180
    EndIf
    Next
    #endregion

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

    #region
    Opt("GUIOnEventMode", 1)

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

    $Form1 = GUICreate("1", 800, 200, 100, 205, $WS_POPUP)
    GUISetBkColor(0x000000)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Ende")
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "Move") ; Linke Maustaste gedrückt
    GUISetOnEvent($GUI_EVENT_SECONDARYUP, "Optionen") ; Rechte Maustaste losgelassen

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

    $Form2 = GUICreate("2", 800, 50, -1, -1, $WS_POPUP, -1, $Form1)
    GUISetBkColor(0xFFFFFF)
    $exitbutton = GUICtrlCreateButton("Fertig", 750, 10, 40, 30)
    GUICtrlSetOnEvent(-1, "Fertig")
    $transslider = GUICtrlCreateSlider(10, 10, 150, 30)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlSetLimit(-1, 255)
    GUICtrlSetOnEvent(-1, "Transparenz")

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

    _GDIPlus_Startup()
    Global $grafik = _GDIPlus_GraphicsCreateFromHWND($Form1)
    Global $Brush = _GDIPlus_BrushCreateSolid(0xff00bb00)
    Global $Brush1 = _GDIPlus_BrushCreateSolid(0xFF000000)
    #endregion

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

    $SEC = @SEC ; Uhr "synchroniseren"
    While $SEC = @SEC
    Sleep(10)
    WEnd

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

    GUISetState(@SW_SHOW, $Form1)

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

    While True
    uhrzeit()
    Sleep(10)
    WEnd

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

    Func Quit()
    _GDIPlus_GraphicsDispose($grafik)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

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

    Func Move()
    If BitAND(WinGetState($Form2), 2) Then Return ; $Form2 ist bereits sichtbar: nicht verschieben
    DllCall("User32.dll", "Bool", "PostMessage", "HWND", $Form1, "UINT", $WM_NCLBUTTONDOWN, "WPARAM", $HTCAPTION, "LPARAM", 0)
    EndFunc

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

    Func optionen()
    If BitAND(WinGetState($Form2), 2) Then Return ; $Form2 ist bereits sichtbar: nicht neu anzeigen
    Local $aResult = WinGetPos($Form1)
    WinMove($Form2, "", $aResult[0], $aResult[1] + $aResult[3])
    GUICtrlSetData($transslider, $trans) ; Slider auf aktuellen Wert von $trans setzen
    GUISetState(@SW_SHOW, $Form2)
    EndFunc ;==>optionen

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

    Func Fertig()
    GUISetState(@SW_HIDE, $Form2)
    EndFunc

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

    Func Transparenz()
    $trans = GUICtrlRead(@GUI_CtrlId)
    WinSetTrans($Form1, "", $trans)
    EndFunc

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

    Func uhrzeit()
    If $SEC = @SEC Then Return ; nur bei neuer Sekunde aktualisieren
    $SEC = @SEC
    $uhr = _NowTime(5)
    $zeit = StringSplit($uhr, ":")
    $St1 = StringLeft($zeit[1], 1)
    $St2 = StringRight($zeit[1], 1)
    $Min1 = StringLeft($zeit[2], 1)
    $Min2 = StringRight($zeit[2], 1)
    $Sek1 = StringLeft($zeit[3], 1)
    $Sek2 = StringRight($zeit[3], 1)
    ziffer($St1, 1)
    ziffer($St2, 2)
    ziffer($Min1, 3)
    ziffer($Min2, 4)
    ziffer($Sek1, 5)
    ziffer($Sek2, 6)
    $Stunde1 = StringSplit($ziffer[1], ",")
    $Stunde2 = StringSplit($ziffer[2], ",")
    $Minute1 = StringSplit($ziffer[3], ",")
    $Minute2 = StringSplit($ziffer[4], ",")
    $Sekunde1 = StringSplit($ziffer[5], ",")
    $Sekunde2 = StringSplit($ziffer[6], ",")
    $wo[0] = $uhr
    For $a = 1 To 6
    For $b = 1 To 7
    $segmentort = StringSplit($ziffer[$a], ",")
    $wo1 = StringSplit($wo[$a], ",")
    $wo2[$a][$b] = $wo1[$b]
    If $wo2[$a][$b] = 1 Then
    $segmentort1[$a][$b] = "1|" & $segmentort[$b]
    Else
    $segmentort1[$a][$b] = "0|" & $segmentort[$b]
    EndIf
    Next
    Next
    segment()
    EndFunc ;==>uhrzeit

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

    Func ziffer(ByRef $zeit, $segment)
    Select
    Case $zeit = "0"
    $wo[$segment] = "1,1,1,1,1,0,1"
    Case $zeit = "1"
    $wo[$segment] = "0,1,0,1,0,0,0"
    Case $zeit = "2"
    $wo[$segment] = "0,1,1,0,1,1,1"
    Case $zeit = "3"
    $wo[$segment] = "0,1,0,1,1,1,1"
    Case $zeit = "4"
    $wo[$segment] = "1,1,0,1,0,1,0"
    Case $zeit = "5"
    $wo[$segment] = "1,0,0,1,1,1,1"
    Case $zeit = "6"
    $wo[$segment] = "1,0,1,1,1,1,1"
    Case $zeit = "7"
    $wo[$segment] = "0,1,0,1,1,0,0"
    Case $zeit = "8"
    $wo[$segment] = "1,1,1,1,1,1,1"
    Case $zeit = "9"
    $wo[$segment] = "1,1,0,1,1,1,0"
    EndSelect
    Return $wo
    EndFunc ;==>ziffer

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

    Func segment()
    Local $px1 = 250, $px2 = 495, $ww = ""
    _GDIPlus_GraphicsFillEllipse($grafik, $px1, 60, 15, 15, $Brush)
    _GDIPlus_GraphicsFillEllipse($grafik, $px1, 120, 15, 15, $Brush)
    _GDIPlus_GraphicsFillEllipse($grafik, $px2, 60, 15, 15, $Brush)
    _GDIPlus_GraphicsFillEllipse($grafik, $px2, 120, 15, 15, $Brush)
    For $a = 1 To 6
    For $b = 1 To 7
    $ww = $ww & $segmentort1[$a][$b] & ","
    Next
    Next
    $ww1 = StringSplit($ww, ",")
    For $a = 1 To 42
    If StringLeft($ww1[$a], 1) = "1" Then
    $senkrecht1 = StringSplit($array[StringTrimLeft($ww1[$a], 2)], ",")
    $array2[0][0] = 6
    $array2[1][0] = $senkrecht1[1]
    $array2[1][1] = $senkrecht1[2]
    $array2[2][0] = $senkrecht1[3]
    $array2[2][1] = $senkrecht1[4]
    $array2[3][0] = $senkrecht1[5]
    $array2[3][1] = $senkrecht1[6]
    $array2[4][0] = $senkrecht1[7]
    $array2[4][1] = $senkrecht1[8]
    $array2[5][0] = $senkrecht1[9]
    $array2[5][1] = $senkrecht1[10]
    $array2[6][0] = $senkrecht1[11]
    $array2[6][1] = $senkrecht1[12]
    _GDIPlus_GraphicsFillPolygon($grafik, $array2, $Brush)
    Else
    $senkrecht1 = StringSplit($array[StringTrimLeft($ww1[$a], 2)], ",")
    $array2[0][0] = 6
    $array2[1][0] = $senkrecht1[1]
    $array2[1][1] = $senkrecht1[2]
    $array2[2][0] = $senkrecht1[3]
    $array2[2][1] = $senkrecht1[4]
    $array2[3][0] = $senkrecht1[5]
    $array2[3][1] = $senkrecht1[6]
    $array2[4][0] = $senkrecht1[7]
    $array2[4][1] = $senkrecht1[8]
    $array2[5][0] = $senkrecht1[9]
    $array2[5][1] = $senkrecht1[10]
    $array2[6][0] = $senkrecht1[11]
    $array2[6][1] = $senkrecht1[12]
    _GDIPlus_GraphicsFillPolygon($grafik, $array2, $Brush1)
    EndIf
    Next
    Sleep(500)
    _GDIPlus_GraphicsFillEllipse($grafik, $px1, 60, 15, 15, $Brush1)
    _GDIPlus_GraphicsFillEllipse($grafik, $px1, 120, 15, 15, $Brush1)
    _GDIPlus_GraphicsFillEllipse($grafik, $px2, 60, 15, 15, $Brush1)
    _GDIPlus_GraphicsFillEllipse($grafik, $px2, 120, 15, 15, $Brush1)
    EndFunc ;==>segment

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

    Func Ende()
    _GDIPlus_GraphicsDispose($grafik)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>ende

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

    Func RGB2BGR($iColor)
    Local $sH = Hex($iColor, 6)
    Return '0x' & StringRight($sH, 2) & StringMid($sH, 3, 2) & StringLeft($sH, 2)
    EndFunc ;==>RGB2BGR

    [/autoit]