1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. UEZ

Beiträge von UEZ

  • GDI+: Fussball Chronograph v1.4 Build 2010-03-09

    • UEZ
    • 9. Februar 2010 um 16:17

    Ich weiß nicht, wo für das gut sein soll, aber ich habe es einfach mal programmiert, nach dem SEuBO, Andy, Oscar und Progandy ihren Beitrag zu diesem Thema geleistet haben!

    Spoiler anzeigen
    [autoit]


    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    #AutoIt3Wrapper_Run_After=del /f /q "Fussball Chronograph_Obfuscated.au3"
    #AutoIt3Wrapper_Res_Description=Fussball Chronograph v1.4 by (c) UEZ 2010
    #AutoIt3Wrapper_Res_Fileversion=1.4
    #AutoIt3Wrapper_Res_LegalCopyright=UEZ 2010
    #AutoIt3Wrapper_Res_Language=1031
    #AutoIt3Wrapper_Res_Field=Coded by|UEZ
    #AutoIt3Wrapper_UseX64=n
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Icon="Images\Fussball Chronograph.ico"
    ;~ #AutoIt3Wrapper_Run_After=upx.exe --ultra-brute "%out%"
    #AutoIt3Wrapper_Run_After=upx.exe --best "%out%"

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

    #Region includes
    #include <ButtonConstants.au3>
    #include <FontConstants.au3>
    #include <GDIplus.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiStatusBar.au3>
    #include <ProgressConstants.au3>
    #include <Sound.au3>
    #include <StaticConstants.au3>
    #Include <String.au3>
    #include <WindowsConstants.au3>
    #EndRegion

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

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

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

    #Region Dateien Check
    If Not FileExists(@ScriptDir & "\Images\Hintergrund.jpg") Then
    MsgBox(16, "Error", "Datei 'Images\Hintergrund.jpg' nicht gefunden!" & @CRLF & @CRLF & _
    "Programm wird beendet!", 15)
    Exit
    EndIf
    If Not FileExists(@ScriptDir & "\Images\Stoppuhr.png") Then
    MsgBox(16, "Error", "Datei 'Images\Stoppuhr.png' nicht gefunden!" & @CRLF & @CRLF & _
    "Programm wird beendet!", 15)
    Exit
    EndIf
    If Not FileExists(@ScriptDir & "\Audio\Whistle_Start.mp3") Then
    MsgBox(16, "Error", "Datei 'Audio\Whistle_Start.mp3' nicht gefunden!" & @CRLF & @CRLF & _
    "Programm wird beendet!", 15)
    Exit
    EndIf
    If Not FileExists(@ScriptDir & "\Audio\Whistle_End.mp3") Then
    MsgBox(16, "Error", "Datei 'Audio\Whistle_End.mp3' nicht gefunden!" & @CRLF & @CRLF & _
    "Programm wird beendet!", 15)
    Exit
    EndIf
    #EndRegion

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

    #Region General parameters
    Local $titel = "Fussball Chronograph v1.4"
    Local $build = " Build 2010-03-09"
    Local $coder = "by UEZ 2010"
    Local $os = @OSBuild
    Switch $os
    Case 0 To 3790
    Local $StatusBar_Text = $titel & " " & $coder & "......................................................................................."
    Local $SB_i = 160, $SB_j = 1, $SB_i_limes = 79, $space_string = "."
    Case Else
    Local $StatusBar_Text = $titel & " " & $coder
    Local $SB_i = 195, $SB_j = 1, $SB_i_limes = 101, $space_string = " "
    EndSwitch
    Local $StatusBar_checked = False
    Local $audio = True
    Local $zeit_puffer1, $zeit_puffer2, $zeit_puffer3, $zeit_puffer4, $zeit_netto, $zeiger
    Local $limes = 59
    Local $halbzeit = 0
    Local $status = 1 ;"Anpfiff"
    #EndRegion

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

    #Region Ini
    Local $AoT, $audio
    Local $ini = @ScriptDir & "\Fussball Chronograph.ini"
    If Not FileExists($ini) Then
    Create_Ini(1)
    Else
    $AoT = IniRead($ini, "Einstellungen", "AoT", "1")
    $audio = IniRead($ini, "Einstellungen", "Audio", "1")
    EndIf
    #EndRegion
    #region GUI About Initialisierung
    Local $hGUI_About, $hGraphic_About, $hDC, $hCDC, $hTheme
    Local $hbackground, $hDIBBmp, $hOldBmp, $hFont_About, $hOldFont, $hBrush
    Local $pBitmapData, $tBmpInfo, $tDTTOptions, $pDTTOptions, $tClientRect, $pClientRect
    Local $hBMP_About, $hImage_About, $hBitmap_About, $hBackbuffer_About, $hScrDC, $hDC_backbuffer, $DC_obj, $hBackbuffer_About
    Local $iXX = 900, $iYY = 400
    Local $fHigh = 50, $fWidth = 30, $fESC = 0, $fOrient = 0, $fWeight = 500
    Local $fItalic = 0, $fUnderline = 0, $fStrikeout = 0
    Local $fCharset = $DEFAULT_CHARSET, $fOutputPrec = $OUT_DEFAULT_PRECIS, $fClipPrec = $CLIP_DEFAULT_PRECIS, $fQuality = $PROOF_QUALITY
    Local $fPitch = $DEFAULT_PITCH, $fFace = 'Courier New'
    Local $fGlowsize = 16
    Local $atext = @CRLF & $titel & $build & @CRLF & @CRLF & "by UEZ 2010"
    #endregion

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

    #Region GUI Initialisierung
    Local Const $iX = 518
    Local Const $iY = 732

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

    Local $hWnd = GUICreate($titel & $build, $iX, $iY, -1, -1, $WS_SYSMENU)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Ende")

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

    Local $MenuItem1, $MenuItem2, $MenuItem3, $MenuItem4, $MenuItem5, $MenuItem6, $MenuItem7, $MenuItem8
    $MenuItem1 = GUICtrlCreateMenu("&?")
    $MenuItem3 = GUICtrlCreateMenu("Einstellungen", $MenuItem1)
    $MenuItem4 = GUICtrlCreateMenuItem("Always on top", $MenuItem3)
    If $AoT = 1 Then
    GUICtrlSetState(-1, $GUI_CHECKED)
    WinSetOnTop($hwnd, "", True)
    EndIf
    GUICtrlSetOnEvent(-1, "Settings_GUI")
    $MenuItem7 = GUICtrlCreateMenuItem("Audio", $MenuItem3)
    If $audio = 1 Then GUICtrlSetState(-1, $GUI_CHECKED)
    GUICtrlSetOnEvent(-1, "Settings_Audio")
    $MenuItem8 = GUICtrlCreateMenuItem("Reset", $MenuItem1, -1 , 0)
    GUICtrlSetOnEvent(-1, "Reset2")
    $MenuItem2 = GUICtrlCreateMenuItem("Über", $MenuItem1, -1 , 0)
    GUICtrlSetOnEvent(-1, "About")
    $MenuItem5 = GUICtrlCreateMenuItem("", $MenuItem1, -1 , 1)
    $MenuItem6 = GUICtrlCreateMenuItem("Ende", $MenuItem1, -1 , 0)
    GUICtrlSetOnEvent(-1, "_Ende")

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

    Local $Progress1 = GUICtrlCreateProgress(20, 22, 34, 352, $PBS_SMOOTH + $PBS_VERTICAL + $WS_BORDER)
    GUICtrlSetData(-1, 0)
    Local $Progress2 = GUICtrlCreateProgress(458, 22, 34, 352, $PBS_SMOOTH + $PBS_VERTICAL + $WS_BORDER)
    GUICtrlSetData(-1, 0)

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

    Local $Pic1 = GUICtrlCreatePic("Images\Hintergrund.jpg", 0, -15, $iX, $iY, $WS_GROUP + $WS_CLIPSIBLINGS)
    GUICtrlSetState(-1, 128)

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

    Local $Button = GUICtrlCreateButton("&Anpfiff", 12, 568, 488, 57, -1, -1)
    GUICtrlSetState(-1, $GUI_ENABLE)
    GUICtrlSetFont(-1, 32, 400, 0, "Arial")
    Local $timer_start, $timer, $zeit = "00:00"
    GUICtrlSetOnEvent(-1, "Check_Status")

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

    Local $Checkbox = GUICtrlCreateCheckbox("", 12, 639, 14, 14)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUICtrlSetOnEvent($Checkbox, "Check_Checkbox")

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

    Local $Label2 = GUICtrlCreateLabel("Verlängerung", 28, 639, 70, 18)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetBKColor(-1, $GUI_BKCOLOR_TRANSPARENT)

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

    Local $StatusBar = _GUICtrlStatusBar_Create($hWnd)

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

    Local $Group1 = GUICtrlCreateGroup("", 12, 384, 488, 166)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState()

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

    Display_Rotated_Text($hWnd, "1. Halbzeit", 6, 373, 90, 800)
    Display_Rotated_Text($hWnd, "2. Halbzeit", 506, 319, 270, 800)
    #EndRegion

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

    #Region GDI+ Initialisation
    _GDIPlus_Startup()
    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)

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

    Local $hBitmap_clock = _GDIPlus_BitmapCreateFromGraphics(352, 348, $hGraphics)
    Local $hBackbuffer_clock = _GDIPlus_ImageGetGraphicsContext($hBitmap_clock)
    Local $hBitmap_time = _GDIPlus_BitmapCreateFromGraphics(433, 156, $hGraphics)
    Local $hBackbuffer_time = _GDIPlus_ImageGetGraphicsContext($hBitmap_time)
    _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer_time, 2)
    _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer_clock, 2)
    Local $hImage = _GDIPlus_BitmapCreateFromFile("Images\Stoppuhr.png")
    Local Const $cX = _GDIPlus_ImageGetWidth($hImage)
    Local Const $cY = _GDIPlus_ImageGetHeight($hImage)
    Local $hBackround = _GDIPlus_BitmapCreateFromFile("Images\Hintergrund.jpg")
    Local $hPen1 = _GDIPlus_PenCreate(0xFF101030, 5) ;grosser Zeiger Hintergrund
    Local $hPen2 = _GDIPlus_PenCreate(0xFFC0C080, 1) ;grosser Zeiger Vordergrund
    Local $hPen3 = _GDIPlus_PenCreate(0xFF101060, 3) ;kleiner Zeiger
    Local $hPen4 = _GDIPlus_PenCreate(0xFF302040, 7) ;Knopf in der Mitte
    Local $hPen5 = _GDIPlus_PenCreate(0xFF808020, 2) ;Licht auf Knopf
    Local $hBrush_font = _GDIPlus_BrushCreateSolid(0xFF000000)
    Local $hBrush_clock_g = _GDIPlus_BrushCreateSolid(0x8000E000)
    Local $hBrush_clock_r = _GDIPlus_BrushCreateSolid(0x80D00000)

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

    Local $hFormat = _GDIPlus_StringFormatCreate ()
    Local $hFamily = _GDIPlus_FontFamilyCreate ("Arial")
    Local $hFont = _GDIPlus_FontCreate ($hFamily, 110, 0)
    Local $tLayout = _GDIPlus_RectFCreate (0, 0, 433, 156)

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

    Local $hPath, $hCustomLineCap, $avCaps, $GDIP_STATUS
    Local Const $LineCapTriangle = 3, $LineCapRound = 2, $DashCapFlat = 0
    $hPath = _GDIPlus_PathCreate()
    $hCustomLineCap = _GDIPlus_CustomLineCapCreate(0, $hPath)
    _GDIPlus_CustomLineCapSetStrokeCaps($hCustomLineCap, $LineCapRound, $LineCapTriangle)
    $avCaps = _GDIPlus_CustomLineCapGetStrokeCaps($hCustomLineCap)
    _GDIPlus_PenSetLineCap($hPen1, $avCaps[0], $avCaps[1], $DashCapFlat)

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

    Local Const $small_needle_radius = 50
    Local Const $small_needle_x = 177
    Local Const $small_needle_y = 113
    Local Const $big_needle_diameter = 325
    Local Const $big_needle_radius1 = 50
    Local Const $big_needle_radius2 = $big_needle_diameter / 2 - 6
    Local Const $big_needle_x = $cX / 2
    Local Const $big_needle_y = $cY / 2
    Local Const $big_needle_button = 8
    Local Const $pie_size = 13
    Local Const $pi_div_180 = 4 * ATan(1) / 180
    Draw_GDIp(0, 0)
    #EndRegion

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

    Local $pfeife_start = _SoundOpen("Audio\Whistle_Start.mp3")
    Local $pfeife_ende = _SoundOpen("Audio\Whistle_End.mp3")

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

    AdlibRegister("Move_Text", 200)

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

    GUIRegisterMsg($WM_PAINT, "Redraw_GUI")

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

    While Sleep(100000)
    WEnd

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

    Func Check_Status()
    Switch $status
    Case 1 ;"Anpfiff"
    If $audio = 1 Then _SoundPlay($pfeife_start, 0)
    $timer_start = TimerInit()
    AdlibRegister("Timer", 1000)
    GUICtrlSetData($Button, "&Ende 1. Halbzeit")
    $status = 2 ;"Halbzeit"
    Case 2 ;"Halbzeit"
    AdlibUnRegister("Timer")
    $zeit_puffer1 = $zeit
    Display_Rotated_Text($hWnd, $zeit_puffer1, 54, 372, 90, 800)
    If $audio = 1 Then _SoundPlay($pfeife_ende, 0)
    $halbzeit = 45
    GUICtrlSetData($Button, "&Start 2. Halbzeit")
    $status = 3
    Case 3 ;"2. Halbzeit"
    Reset_Zeiger()
    If $audio = 1 Then _SoundPlay($pfeife_start, 0)
    $timer_start = TimerInit()
    AdlibRegister("Timer", 1000)
    GUICtrlSetData($Button, "&Ende 2. Halbzeit")
    $status = 4
    Case 4 ;"Ende"
    AdlibUnRegister("Timer")
    $zeit_puffer2 = $zeit_netto
    Display_Rotated_Text($hWnd, $zeit_puffer2, 458, 345, 270, 800)
    If $audio = 1 Then _SoundPlay($pfeife_ende, 0)
    GUICtrlSetState($Checkbox, $GUI_ENABLE)
    GUICtrlSetData($Button, "&Ende")
    $status = 5
    Case 5;"1. Verlängerung"
    If GUICtrlRead($Button) <> "&Ende" Then
    Switch GUICtrlRead($Checkbox)
    Case 1
    GUICtrlSendMsg($Progress1, 0x0410, 1, 0)
    GUICtrlSetState($Checkbox, $GUI_DISABLE)
    GUICtrlSetData($Progress1, 0)
    GUICtrlSetData($Progress2, 0)
    Reset_Zeiger()
    If $audio = 1 Then _SoundPlay($pfeife_start, 0)
    $halbzeit = 90
    $limes = 30
    $timer_start = TimerInit()
    AdlibRegister("Timer", 1000)
    GUICtrlSetData($Button, "&Ende 1. Verlängerung")
    $status = 6
    EndSwitch
    Else
    Reset()
    EndIf
    Case 6 ;"Halbzeit Verlängerung"
    AdlibUnRegister("Timer")
    $zeit_puffer3 = $zeit_netto
    Display_Rotated_Text($hWnd, $zeit_puffer3, 54, 337, 90, 800)
    If $audio = 1 Then _SoundPlay($pfeife_ende, 0)
    GUICtrlSetData($Button, "&Verlängerung 2. Halbzeit")
    $status = 7
    Case 7 ;"2. Verlängerung"
    GUICtrlSendMsg($Progress2, 0x0410, 1, 0)
    Reset_Zeiger()
    If $audio = 1 Then _SoundPlay($pfeife_start, 0)
    $halbzeit = 105
    $timer_start = TimerInit()
    AdlibRegister("Timer", 1000)
    GUICtrlSetData($Button, "&Ende 2. Verlängerung")
    $status = 8
    Case 8 ;"Spiel Ende"
    AdlibUnRegister("Timer")
    $zeit_puffer4 = $zeit_netto
    Display_Rotated_Text($hWnd, $zeit_puffer4, 458, 310, 270, 800)
    If $audio = 1 Then _SoundPlay($pfeife_ende, 0)
    GUICtrlSetData($Button, "&Neustart")
    $status = 9
    Case 9 ;Neustart
    Reset()
    EndSwitch
    EndFunc

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

    Func Reset_Zeiger($schlafe = 5)
    Local $i
    GUICtrlSetState($Button, $GUI_DISABLE)
    For $i = Int($zeiger) To 0 Step - 1
    Draw_GDIp(0, $i)
    Sleep($schlafe)
    Next
    GUICtrlSetState($Button, $GUI_ENABLE)
    EndFunc

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

    Func Timer()
    Local $sec, $min, $t = TimerDiff($timer_start) ;* 88 ;Turbo Zeit zum Testen ;)
    $sec = Floor(Mod($t / 1000, 60))
    $min = Floor($t / (1000 * 60)) + $halbzeit
    $zeit_netto = StringFormat("%02d:%02d", $min - $halbzeit, $sec)
    $zeit = StringFormat("%02d:%02d", $min, $sec)
    If $min - $halbzeit <= $limes Then
    Switch $status
    Case 2
    If $min > 45 Then GUICtrlSendMsg($Progress1, 0x0410, 2, 0)
    GUICtrlSetData($Progress1, $min * 1.66666667)
    Case 6
    $min -= $halbzeit
    If $min > 15 Then GUICtrlSendMsg($Progress1, 0x0410, 2, 0)
    GUICtrlSetData($Progress1, $min * 1.66666667)
    Case 4, 8
    $min -= $halbzeit
    If $min > 45 And $status = 4 Then GUICtrlSendMsg($Progress2, 0x0410, 2, 0)
    If $min > 15 And $status = 8 Then GUICtrlSendMsg($Progress2, 0x0410, 2, 0)
    GUICtrlSetData($Progress2, $min * 1.66666667)
    EndSwitch
    $zeiger = $min + $sec / 60
    Draw_GDIp($sec, $zeiger)
    Else
    AdlibUnRegister("Timer")
    EndIf
    EndFunc

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

    Func Check_Checkbox()
    If BitAND(GUICtrlRead($Checkbox), $GUI_CHECKED) Then
    GUICtrlSetData($Button, "&Start Verlängerung")
    Else
    GUICtrlSetData($Button, "&Ende")
    EndIf
    EndFunc

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

    Func Draw_GDIp($angle_small, $angle_big)
    Local $x1, $x2, $y1, $y2
    Local $xx1, $xx2, $yy1, $yy2
    $angle_small -= 270
    _GDIPlus_GraphicsClear($hBackbuffer_clock, 0x00000000)
    _GDIPlus_GraphicsDrawImage($hBackbuffer_clock, $hImage, 0, 0) ;zeichne Uhr, damit die Zeiger gelöscht werden
    _GDIPlus_GraphicsDrawImageRectRect($hBackbuffer_time, $hBackround, 36, 394, 433, 156, 0, 0, 433, 156) ;zeichne Stadion, damit die Zeiger gelöscht werden

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

    _GDIPlus_GraphicsDrawLine($hBackbuffer_clock, $small_needle_x, $small_needle_y, _ ;zeichne kleinen Zeiger
    $small_needle_x + $small_needle_radius * Sin($angle_small * -6 * $Pi_Div_180), _
    $small_needle_y + $small_needle_radius * Cos($angle_small * -6 * $Pi_Div_180), $hPen3)
    Switch $status ;zeichne Kreisdiagramm
    Case 2, 4
    Switch $angle_big
    Case 45 To 60
    _GDIPlus_GraphicsFillPie($hBackbuffer_clock, $pie_size, $pie_size, $big_needle_diameter, $big_needle_diameter, -90, 45 * 6, $hBrush_clock_g)
    _GDIPlus_GraphicsFillPie($hBackbuffer_clock, $pie_size, $pie_size, $big_needle_diameter, $big_needle_diameter, -180, ($angle_big - 45) * 6, $hBrush_clock_r)
    Case Else
    _GDIPlus_GraphicsFillPie($hBackbuffer_clock, $pie_size, $pie_size, $big_needle_diameter, $big_needle_diameter, -90, $angle_big * 6, $hBrush_clock_g)
    EndSwitch
    Case 6, 8
    Switch $angle_big
    Case 15 To 30
    _GDIPlus_GraphicsFillPie($hBackbuffer_clock, $pie_size, $pie_size, $big_needle_diameter, $big_needle_diameter, -90, 15 * 6, $hBrush_clock_g)
    _GDIPlus_GraphicsFillPie($hBackbuffer_clock, $pie_size, $pie_size, $big_needle_diameter, $big_needle_diameter, 0, ($angle_big - 15) * 6, $hBrush_clock_r)
    Case Else
    _GDIPlus_GraphicsFillPie($hBackbuffer_clock, $pie_size, $pie_size, $big_needle_diameter, $big_needle_diameter, -90, $angle_big * 6, $hBrush_clock_g)
    EndSwitch
    EndSwitch

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

    $x1 = $big_needle_x - $big_needle_radius1 * Sin(($angle_big - 210) * -6 * $Pi_Div_180)
    $y1 = $big_needle_y - $big_needle_radius1 * Cos(($angle_big - 210) * -6 * $Pi_Div_180)
    $x2 = $big_needle_x + $big_needle_radius2 * Sin(($angle_big - 30) * -6 * $Pi_Div_180)
    $y2 = $big_needle_y + $big_needle_radius2 * Cos(($angle_big - 30) * -6 * $Pi_Div_180)
    $xx1 = $big_needle_x - ($big_needle_radius1 - 2 )* Sin(($angle_big - 210) * -6 * $Pi_Div_180)
    $yy1 = $big_needle_y - ($big_needle_radius1 - 2 ) * Cos(($angle_big - 210) * -6 * $Pi_Div_180)
    $xx2 = $big_needle_x + ($big_needle_radius2 - 3) * Sin(($angle_big - 30) * -6 * $Pi_Div_180)
    $yy2 = $big_needle_y + ($big_needle_radius2 - 3) * Cos(($angle_big - 30) * -6 * $Pi_Div_180)
    _GDIPlus_GraphicsDrawLine($hBackbuffer_clock, $x1, $y1, $x2, $y2, $hPen1) ;zeichne großen Zeiger
    _GDIPlus_GraphicsDrawLine($hBackbuffer_clock, $xx1, $yy1, $xx2, $yy2, $hPen2) ;zeichne Linie auf großen Zeiger

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

    _GDIPlus_GraphicsDrawEllipse($hBackbuffer_clock, $big_needle_x - $big_needle_button * 0.5, $big_needle_y - $big_needle_button * 0.5, _ ;Knopf
    $big_needle_button, $big_needle_button, $hPen4)
    _GDIPlus_GraphicsDrawArc ($hBackbuffer_clock, $big_needle_x - $big_needle_button * 0.5, $big_needle_y - $big_needle_button * 0.5, _ ;Licht auf Knopf
    $big_needle_button, $big_needle_button, 50, -180, $hPen5)

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

    _GDIPlus_GraphicsDrawStringEx ($hBackbuffer_time, $zeit, $hFont, $tLayout, $hFormat, $hBrush_font) ;zeichne Spielzeit
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap_time, 38, 392, 433, 156) ;kopiere Spielzeit in die GUI
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap_clock, 80, 24, 352, 348) ;kopiere Uhr in die GUI
    EndFunc

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

    Func Reset()
    $zeit = "00:00"
    $limes = 60
    $halbzeit = 0
    GUICtrlSetData($Button, "&Anpfiff")
    GUICtrlSetState($Checkbox, $GUI_UNCHECKED)
    GUICtrlSetState($Checkbox, $GUI_DISABLE)
    GUICtrlSetData($Progress1, 0)
    GUICtrlSetData($Progress2, 0)
    $zeit = "00:00"
    Reset_Zeiger()
    $status = 1
    GUICtrlSendMsg($Progress1, 0x0410, 1, 0)
    GUICtrlSendMsg($Progress2, 0x0410, 1, 0)
    _WinAPI_RedrawWindow($hWnd, "", "", $RDW_INVALIDATE)
    EndFunc

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

    Func Reset2()
    Local $chk
    WinSetOnTop($hwnd, "", False)
    $chk = MsgBox(4, "Reset", "Wirklich alles resetten?")
    If $chk = 6 Then
    AdlibUnRegister("Timer")
    Reset()
    EndIf
    If BitAND(GUICtrlRead($MenuItem4), $GUI_CHECKED) = $GUI_CHECKED Then WinSetOnTop($hwnd, "", True)
    EndFunc

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

    Func _Ende()
    $AoT = BitAND(GUICtrlRead($MenuItem4), $GUI_CHECKED)
    $audio = BitAND(GUICtrlRead($MenuItem7), $GUI_CHECKED)
    WinSetOnTop($hwnd, "", False)
    Local $box = MsgBox(36, "Ende", "Soll das Programm wirklich geschlossen werden?")
    If $box = 7 Then
    If $AoT = $GUI_CHECKED Then WinSetOnTop($hwnd, "", True)
    Return
    EndIf
    Create_Ini(0, $AoT, $audio)
    _SoundClose($pfeife_start)
    _SoundClose($pfeife_ende)
    AdlibUnRegister("Timer")
    GUIRegisterMsg($WM_PAINT, "")
    _GDIPlus_CustomLineCapDispose($hCustomLineCap)
    _GDIPlus_PathDispose($hPath)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_PenDispose($hPen1)
    _GDIPlus_PenDispose($hPen2)
    _GDIPlus_PenDispose($hPen3)
    _GDIPlus_PenDispose($hPen4)
    _GDIPlus_PenDispose($hPen5)
    _GDIPlus_BrushDispose($hBrush_clock_g)
    _GDIPlus_BrushDispose($hBrush_clock_r)
    _GDIPlus_BrushDispose($hBrush_font)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_ImageDispose($hBackround)
    _GDIPlus_BitmapDispose($hBitmap_clock)
    _GDIPlus_GraphicsDispose($hBackbuffer_clock)
    _GDIPlus_BitmapDispose($hBitmap_time)
    _GDIPlus_GraphicsDispose($hBackbuffer_time)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    AdlibUnRegister("Move_Text")
    GUIDelete($hwnd)
    Exit
    EndFunc

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

    Func Move_Text()
    Local $txt
    $txt = _StringRepeat($space_string, $SB_i) & $StatusBar_Text
    _GUICtrlStatusBar_SetText($StatusBar, $txt)
    $SB_i -= $SB_j
    If $SB_i = 0 Or ($SB_i = $SB_i_limes And $StatusBar_checked) Then
    $SB_j *= -1
    $StatusBar_checked = True
    EndIf
    EndFunc

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

    ;danke an BugFix für das Beispiel
    Func Display_Rotated_Text($hGUI, $text, $px, $py, $angle = 90, $tw = 400, $th = 12, $tcolor = 0x000000, $bcolor = 0xF0F0F0, $font = 'Arial', $transparent = True)
    Local $tRect, $rotate, $RotateMe, $rFont, $hDC

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

    ; Create RECT-structure, fill data
    $tRect = DllStructCreate ($tagRECT)
    DllStructSetData ($tRect, 'Left', $px)
    DllStructSetData ($tRect, 'Top', $py)

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

    ; Set rotation
    $rotate = $angle * 10

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

    ; Create structure for rotate text, fill data
    $RotateMe = DllStructCreate ($tagLOGFONT)
    DllStructSetData ($RotateMe, 'Escapement', $rotate)
    DllStructSetData ($RotateMe, 'Weight', $tw)
    DllStructSetData ($RotateMe, 'Height', $th)
    DllStructSetData ($RotateMe, 'FaceName', $font)

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

    ; Creates a logical font that has specific characteristics
    $rFont = _WinAPI_CreateFontIndirect ($RotateMe)

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

    ; Retrieves a handle of a display device context for the client area a window
    $hDC = _WinAPI_GetDC ($hGUI)

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

    ; Set text- and back color
    _WinAPI_SetTextColor ($hDC, $tcolor)
    _WinAPI_SetBkColor ($hDC, $bcolor)
    If $transparent Then _WinAPI_SetBkMode($hDC, $TRANSPARENT)

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

    ; Selects an object into the specified device context
    _WinAPI_SelectObject ($hdc, $rFont)

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

    ; Draws formatted text in the specified rectangle
    _WinAPI_DrawText ($hDC, $text, $tRect, $DT_NOCLIP + $DT_NOPREFIX)

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

    $tRect = 0
    EndFunc

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

    Func Settings_GUI()
    If BitAND(GUICtrlRead($MenuItem4), $GUI_CHECKED) = $GUI_CHECKED Then
    GUICtrlSetState($MenuItem4, $GUI_UNCHECKED)
    ;~ GUISetStyle(0x14C80000, -1, $hWnd)
    WinSetOnTop($hwnd, "", False)
    Else
    GUICtrlSetState($MenuItem4, $GUI_CHECKED)
    ;~ GUISetStyle(0x14C80000, 0x00000108, $hWnd)
    WinSetOnTop($hwnd, "", True)
    EndIf
    EndFunc

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

    Func Settings_Audio()
    If BitAND(GUICtrlRead($MenuItem7), $GUI_CHECKED) = $GUI_CHECKED Then
    GUICtrlSetState($MenuItem7, $GUI_UNCHECKED)
    $audio = False
    Else
    GUICtrlSetState($MenuItem7, $GUI_CHECKED)
    $audio = True
    EndIf
    EndFunc

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

    Func Create_Ini($new = 1, $val1 = 1, $val2 = 1)
    Local $err
    If $new = 1 Then
    IniWriteSection($ini, "Einstellungen", "AoT=1" & @LF & "Audio=1")
    $err = @error
    $AoT = 1
    $audio = 1
    Else
    IniWriteSection($ini, "Einstellungen", "AoT=" & $val1 & @LF & "Audio=" & $val2)
    $err = @error
    EndIf
    Return $err
    EndFunc

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

    Func Redraw_GUI($hWnd, $msg, $wParam, $lParam)
    _WinAPI_RedrawWindow($hWnd, "", "", $RDW_UPDATENOW + $RDW_FRAME)
    Redraw_GUI_GDIp()
    Return $GUI_RUNDEFMSG
    EndFunc ;==>Redraw_GUI

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

    Func Redraw_GUI_GDIp()
    Display_Rotated_Text($hWnd, "1. Halbzeit", 6, 373, 90, 800)
    Display_Rotated_Text($hWnd, "2. Halbzeit", 506, 319, 270, 800)
    If $status > 2 Then Display_Rotated_Text($hWnd, $zeit_puffer1, 54, 372, 90, 800)
    If $status > 4 Then Display_Rotated_Text($hWnd, $zeit_puffer2, 458, 345, 270, 800)
    If $status > 6 Then Display_Rotated_Text($hWnd, $zeit_puffer3, 54, 337, 90, 800)
    If $status > 8 Then Display_Rotated_Text($hWnd, $zeit_puffer4, 458, 310, 270, 800)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap_time, 38, 392, 433, 156)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap_clock, 80, 24, 352, 348)
    Return
    EndFunc

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

    Func About() ;danke an Authenticity für das Beispiel!
    GUISetState(@SW_DISABLE, $hwnd)
    If @OSBuild > 3790 Then
    Opt("GUIOnEventMode", 0)
    Local Const $DTT_GLOWSIZE = 0x00000800, $DTT_TEXTCOLOR = 0x00000001, $DTT_COMPOSITED = 0x00002000, $GDIP_CHOCOLATE = 0xFFD2691E
    Local Const $tagDTTOPTS = "uint Size;uint Flags;uint clrText;uint clrBorder;uint clrShadow;int TextShadowType;" & $tagPOINT & _
    ";int BorderSize;int FontPropId;int ColorPropId;int StateId;int ApplyOverlay;int GlowSize;ptr DrawTextCallback;int lParam;"

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

    $hGUI_About = GUICreate("Über", $iXX, $iYY, -1, -1, $WS_SYSMENU, $WS_EX_TOPMOST)

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

    GUISetState()

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

    $hTheme = _WinAPI_OpenThemeData($hGUI_About, "globals")

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

    $hGraphic_About = _GDIPlus_GraphicsCreateFromHWND($hGUI_About)
    $hDC = _GDIPlus_GraphicsGetDC($hGraphic_About)
    $hCDC = _WinAPI_CreateCompatibleDC($hDC)

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

    $hBMP_About = _WinAPI_CreateBitmap($iXX, $iYY) ;create a dummy bitmap
    $hImage_About = _GDIPlus_BitmapCreateFromHBITMAP($hBMP_About)
    $hBitmap_About = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage_About)

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

    $hScrDC = _WinAPI_GetDC(0)
    $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hScrDC)
    $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hBitmap_About)
    $hBackbuffer_About = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) ;create back buffer bitmap

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

    $tClientRect = _WinAPI_GetClientRect($hGUI_About)
    $pClientRect = DllStructGetPtr($tClientRect)

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

    $tBmpInfo = DllStructCreate($tagBITMAPINFO)
    DllStructSetData($tBmpInfo, "Size", DllStructGetSize($tBmpInfo) - 4)
    DllStructSetData($tBmpInfo, "Width", $iXX)
    DllStructSetData($tBmpInfo, "Height", -$iYY)
    DllStructSetData($tBmpInfo, "Planes", 1)
    DllStructSetData($tBmpInfo, "BitCount", 32)
    DllStructSetData($tBmpInfo, "Compression", 0)

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

    $hDIBBmp = _WinAPI_CreateDIBSection($hDC, $tBmpInfo, $pBitmapData)
    $hFont_About = _WinAPI_CreateFont($fHigh, $fWidth, $fESC, $fOrient, $fWeight, $fItalic, $fUnderline, $fStrikeout, $fCharset, $fOutputPrec, $fClipPrec, $fQuality, $fPitch, $fFace)

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

    $hOldBmp = _WinAPI_SelectObject($hCDC, $hDIBBmp)
    $hOldFont = _WinAPI_SelectObject($hCDC, $hFont_About)
    $tDTTOptions = DllStructCreate($tagDTTOPTS)
    DllStructSetData($tDTTOptions, "Size", DllStructGetSize($tDTTOptions))
    DllStructSetData($tDTTOptions, "Flags", $DTT_GLOWSIZE + $DTT_TEXTCOLOR + $DTT_COMPOSITED)
    DllStructSetData($tDTTOptions, "GlowSize", $fGlowsize)
    DllStructSetData($tDTTOptions, "clrText", _RGBtoBGR($GDIP_CHOCOLATE))
    $pDTTOptions = DllStructGetPtr($tDTTOptions)

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

    _WinAPI_DrawThemeTextEx($hTheme, $hCDC, 0, 0, $atext, $DT_WORD_ELLIPSIS + $DT_WORDBREAK + $DT_CENTER + $DT_NOPREFIX, $pClientRect, $pDTTOptions)

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

    _WinAPI_SelectObject($hCDC, $hOldFont)
    _WinAPI_SelectObject($hCDC, $hOldBmp)
    _WinAPI_DeleteObject($hFont_About)
    _WinAPI_DeleteDC($hCDC)
    _GDIPlus_GraphicsReleaseDC($hGraphic_About, $hDC)

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

    $hBrush = _GDIPlus_LineBrushCreate(0, 0, 0, $iYY / 4, 0, 0, 1)
    $hbackground = _GDIPlus_BitmapCreateFromGdiDib($tBmpInfo, $pBitmapData)
    _GDIPlus_GraphicsDrawImage($hBackbuffer_About, $hbackground, 0, 0)
    _GDIPlus_LineBrushSetColors($hBrush, 0x70000000, 0x70D2691E)
    _GDIPlus_GraphicsFillRect($hBackbuffer_About, 0, $iYY / 2, $iXX, $iYY, $hBrush)
    _WinAPI_BitBlt($hDC, 0, 0, $iXX, $iYY, $hDC_backbuffer, 0, 0, 0x00CC0020)

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

    GUIRegisterMsg($WM_PAINT, "")
    GUIRegisterMsg($WM_PAINT, "Redraw_About")

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

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

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

    GUIRegisterMsg($WM_PAINT, "")
    GUIRegisterMsg($WM_PAINT, "Redraw_GUI")

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

    _GDIPlus_ImageDispose($hbackground)
    _GDIPlus_GraphicsDispose($hGraphic_About)
    _WinAPI_DeleteObject($hDIBBmp)
    _WinAPI_CloseThemeData($hTheme)
    _WinAPI_DeleteObject($hBMP_About)
    _GDIPlus_BitmapDispose($hImage_About)
    _WinAPI_DeleteObject($hBitmap_About)
    _WinAPI_ReleaseDC(0, $hScrDC)
    _WinAPI_SelectObject($hDC_backbuffer, $DC_obj)
    _GDIPlus_GraphicsDispose($hBackbuffer_About)

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

    GUIDelete($hGUI_About)
    Opt("GUIOnEventMode", 1)
    Else
    WinSetOnTop($hwnd, "", False)
    MsgBox(0, "Über", $titel & $build & @CRLF & @CRLF & $coder)
    If BitAND(GUICtrlRead($MenuItem4), $GUI_CHECKED) = $GUI_CHECKED Then WinSetOnTop($hwnd, "", True)
    EndIf
    GUISetState(@SW_ENABLE, $hwnd)
    EndFunc

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

    Func Redraw_About()
    Redraw_GUI_GDIp()
    _WinAPI_BitBlt($hDC, 0, 0, $iXX, $iYY, $hDC_backbuffer, 0, 0, 0x00CC0020)
    EndFunc

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

    Func _RGBtoBGR($iRGB)
    Return Dec(StringMid(Binary($iRGB), 3, 6))
    EndFunc

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

    Func _WinAPI_OpenThemeData($hWnd, $sClassList)
    Local $aResult = DllCall("uxtheme.dll", "hwnd", "OpenThemeData", "hwnd", $hWnd, "wstr", $sClassList)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError(0, 0, $aResult[0])
    EndFunc

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

    Func _WinAPI_CloseThemeData($hTheme)
    Local $aResult = DllCall("uxtheme.dll", "int", "CloseThemeData", "hwnd", $hTheme)
    If @error Then Return SetError(@error, @extended, False)
    Return $aResult[0] = 0
    EndFunc

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

    Func _WinAPI_CreateDIBSection($hDC, $tBmpInfo, ByRef $pBits)
    Local $pBmpInfo, $aResult
    $pBmpInfo = DllStructGetPtr($tBmpInfo)
    $aResult = DllCall("gdi32.dll", "hwnd", "CreateDIBSection", "hwnd", $hDC, "ptr", $pBmpInfo, "uint", 0, "int*", 0, "hwnd", 0, "uint", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] = 87 Then Return SetError(-1, 0, 0)
    If $aResult[0] = 0 Then Return SetError(-2, 0, 0)
    $pBits = $aResult[4]
    Return SetError(0, 0, $aResult[0])
    EndFunc

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

    Func _WinAPI_DrawThemeTextEx($hTheme, $hDC, $iPartId, $iStateId, $sText, $iFlags, $pRect, $pDTTOPTS)
    Local $aResult = DllCall("uxtheme.dll", "int", "DrawThemeTextEx", "ptr", $hTheme, "hwnd", $hDC, "int", $iPartId, "int", $iStateId, "wstr", $sText, "int", -1, "uint", $iFlags, "ptr", $pRect, "ptr", $pDTTOPTS)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError(0, 0, $aResult[0] = 0)
    EndFunc

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

    Func _GDIPlus_BitmapCreateFromGdiDib($tBitmapInfo, $pBitmapData)
    Local $pBitmapInfo, $aResult
    $pBitmapInfo = DllStructGetPtr($tBitmapInfo)
    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromGdiDib", "ptr", $pBitmapInfo, "ptr", $pBitmapData, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[3]
    EndFunc

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

    Func _GDIPlus_LineBrushCreate($nX1, $nY1, $nX2, $nY2, $iARGBClr1, $iARGBClr2, $iWrapMode = 0)
    Local $tPointF1, $pPointF1
    Local $tPointF2, $pPointF2
    Local $aResult
    $tPointF1 = DllStructCreate("float;float")
    $pPointF1 = DllStructGetPtr($tPointF1)
    $tPointF2 = DllStructCreate("float;float")
    $pPointF2 = DllStructGetPtr($tPointF2)
    DllStructSetData($tPointF1, 1, $nX1)
    DllStructSetData($tPointF1, 2, $nY1)
    DllStructSetData($tPointF2, 1, $nX2)
    DllStructSetData($tPointF2, 2, $nY2)
    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", $iARGBClr1, "uint", $iARGBClr2, "int", $iWrapMode, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[6]
    EndFunc

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

    Func _GDIPlus_LineBrushSetColors($hLineGradientBrush, $iARGBStart, $iARGBEnd)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetLineColors", "hwnd", $hLineGradientBrush, "uint", $iARGBStart, "uint", $iARGBEnd)
    If @error Then Return SetError(@error, @extended, False)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[0] = 0
    EndFunc

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

    Func _GDIPlus_PathCreate($iFillMode = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePath", "int", $iFillMode, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[2]
    EndFunc

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

    Func _GDIPlus_CustomLineCapCreate($hPathFill, $hPathStroke, $iLineCap = 0, $nBaseInset = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateCustomLineCap", "hwnd", $hPathFill, "hwnd", $hPathStroke, "int", $iLineCap, "float", $nBaseInset, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[5]
    EndFunc

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

    Func _GDIPlus_CustomLineCapSetStrokeCaps($hCustomLineCap, $iStartCap, $iEndCap)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetCustomLineCapStrokeCaps", "hwnd", $hCustomLineCap, "int", $iStartCap, "int", $iEndCap)
    If @error Then Return SetError(@error, @extended, False)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[0] = 0
    EndFunc

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

    Func _GDIPlus_CustomLineCapGetStrokeCaps($hCustomLineCap)
    Local $aCaps[2], $aResult
    $aResult = DllCall($ghGDIPDll, "uint", "GdipGetCustomLineCapStrokeCaps", "hwnd", $hCustomLineCap, "int*", 0, "int*", 0)
    If @error Then Return SetError(@error, @extended, -1)
    $GDIP_STATUS = $aResult[0]
    If $GDIP_STATUS Then Return -1
    $aCaps[0] = $aResult[2]
    $aCaps[1] = $aResult[3]
    Return $aCaps
    EndFunc

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

    Func _GDIPlus_PenSetLineCap($hPen, $iStartCap, $iEndCap, $iDashCap)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetPenLineCap197819", "hwnd", $hPen, "int", $iStartCap, "int", $iEndCap, "int", $iDashCap)
    If @error Then Return SetError(@error, @extended, False)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[0] = 0
    EndFunc

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

    Func _GDIPlus_PathDispose($hPath)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipDeletePath", "hwnd", $hPath)
    If @error Then Return SetError(@error, @extended, False)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[0] = 0
    EndFunc

    [/autoit]

    Einige Dateien werden benötigt, die im 7-Zip Archiv enthalten sind!


    Hier ein Screenshot: -=> Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.


    Ich hoffe, es bring irgend jemanden was (vielleicht das GDI+ Zeug! :P )

    Gruß,
    UEZ


    Änderungen in v1.1:
    * Ini Datei hinzugefügt, damit die Einstellungen gespeichert werden
    * großen Zeiger vergrößert und Spitze hinzugefügt
    * großer Zeiger verschiebt sich auch auf Sekunden Basis (vorher Minuten Basis)
    * Stoppuhr Bild leicht verbessert
    * bei Verlängerung nach 15 Minuten rote Darstellung des Kreisdiagramms
    * etc.
    Änderungen in v1.2:
    * wusste gar nicht, dass die Schrift in "Über" unter WinXP nicht angezeigt wird -> Win2003 und kleiner wird jetzt "nur" eine Messagebox angezeigt
    * Reset im Menü hinzugefügt, damit man jeder Zeit die Stoppuhr zurück setzen (resetten) kann
    Änderungen in v1.3:
    * das About Fenster hatte kein Redraw (hab's vergessen) -> Danke an m-obi für den Hinweis
    * doppelter Aufruf von GUIRegisterMsg($WM_PAINT, "") -> dadurch kein Repaint auf der Haupt GUI, wenn das "Über" Fenster geöffnet ist (danke SEuBO!)
    * kleinere Bugs beseitigt
    Änderungen in v1.4:
    * "double buffering" des Grafikfensters von "Über" hinzugefügt, damit es nicht so flackert, wenn man es hin und her bewegt
    * kleinere Fehler beseitigt

    Dateien

    Fussball Chronograph.7z 420,27 kB – 697 Downloads Screenshot.jpg 57,86 kB – 0 Downloads
  • Another AutoIt PreProcessor

    • UEZ
    • 7. Februar 2010 um 13:15

    Dieser Code läuft nach dem "PreProcessed" nicht mehr:

    Spoiler anzeigen
    [autoit]


    ;coded by UEZ 2009-01-17 -=> this recursion code is very slow with AutoIt !!! :(
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    #AutoIt3Wrapper_UseUpx=n
    ;~ #AutoIt3Wrapper_Run_After=upx.exe --best "%out%"
    #AutoIt3Wrapper_Run_After=upx.exe --ultra-brute "%out%"
    #AutoIt3Wrapper_Run_After=del "L-System Fractals_Obfuscated.au3"

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

    #include <Array.au3>
    #include <GDIPlus.au3>
    #Include <Misc.au3>

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

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

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

    Global $dll = DllOpen("user32.dll")
    Global Const $Pi = 4 * ATan(1)
    Global Const $Pi_Div_180 = $Pi / 180
    Global Const $width = 800
    Global Const $height = 600
    Global $hGUI, $hWnd, $hGraphic, $Bitmap, $Pen
    Global $angle = 0, $x1, $y1, $x2, $y2, $random
    Global $length, $depth, $dir, $degree, $dist_rel
    Global $font_size, $String_Format, $Font_Family, $Font, $Text_Layout, $Brush, $text

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

    $hGUI = GUICreate("GDI+: L-System Fractals by UEZ 2009 (press F9 to save current image)", $width, $height)
    GUISetState(@SW_SHOW)

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

    GUISetOnEvent(-3, "_Exit")

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

    _GDIPlus_Startup ()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hGUI)
    $Pen = _GDIPlus_PenCreate(0, 1)
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, 4) ; AntiAlias

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

    $font_size = 7
    $String_Format = _GDIPlus_StringFormatCreate ()
    $Font_Family = _GDIPlus_FontFamilyCreate ("Arial")
    $Font = _GDIPlus_FontCreate ($Font_Family, $font_size, 2)
    $Brush = _GDIPlus_BrushCreateSolid (0xDF000000) ;text color

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

    _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)

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

    $random = Random(1, 11, 1)

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

    AdlibRegister("Save_PIC", 50)

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

    While 1
    Switch $random
    Case 1 ;Dragon Curve
    $x1 = $width / 4.2
    $y1 = $height / 2.8
    $length = 500
    $depth = Random(6, 18, 1)
    $dir = 1
    $angle = 0
    $text = "Dragon Curve, Recursion Depth = " & $depth
    Draw_Text()
    Dragon($length, $depth, $dir)
    Case 2 ;Levy-C Curve
    $x1 = $width / 3.65
    $y1 = $height / 2.875
    $length = 475
    $depth = Random(6, 18, 1)
    $dir = 1
    $angle = 0
    $text = "Levy-C Curve, Recursion Depth = " & $depth
    Draw_Text()
    Levy_C($length, $depth, $dir)
    Case 3 ;Koch Curve
    $x1 = $width / 5.3
    $y1 = $height / 1.35
    $x2 = ""
    $y2 = ""
    $length = 500
    $depth = Random(2, 8, 1)
    $dir = 1
    $angle = 0
    $text = "Koch Curve, Recursion Depth = " & $depth
    Draw_Text()
    Koch($length, $depth, $dir) ;F
    Turn(-$dir * 2 * $degree) ;--
    Koch($length, $depth, $dir) ;F
    Turn(-$dir * 2 * $degree) ;--
    Koch($length, $depth, $dir) ;F
    Case 4 ;Peano Curve
    $x1 = $width / 8
    $y1 = $height / 2
    $length = 600
    $depth = Random(2, 5, 1)
    $dir = 1
    $angle = 0
    $text = "Peano Curve, Recursion Depth = " & $depth
    Draw_Text()
    Peano($length, $depth, $dir)
    Case 5 ;Triangle
    $x1 = $width / 10.8
    $y1 = $height / 1.03
    $length = 1300
    $depth = Random(2, 10, 1)
    $dir = 1
    $angle = 0
    $text = "Triangle, Recursion Depth = " & $depth
    Draw_Text()
    Triangle($length, $depth, $dir)
    Case 6 ;Arrowhead Curve
    $x1 = $width / 10.80
    $y1 = $height / 1.05
    $length = 650
    $depth = Random(3, 9, 1)
    $dir = 1
    $angle = 0
    $text = "Arrowhead Curve, Recursion Depth = " & $depth
    Draw_Text()
    Arrowhead_R($length, $depth, $dir) ;R
    Case 7 ;Penta Plexity
    $x1 = $width / 3.55
    $y1 = $height / 15
    $length = 350
    $depth = Random(1, 6, 1)
    $dir = 1
    $angle = 0
    $text = "Penta Plexity, Recursion Depth = " & $depth
    Draw_Text()
    ;F++F++F++F++F
    Penta_Plexity($length, $depth, $dir) ;F
    Turn($dir * 2 * $degree) ;++
    Penta_Plexity($length, $depth, $dir) ;F
    Turn($dir * 2 * $degree) ;++
    Penta_Plexity($length, $depth, $dir) ;F
    Turn($dir * 2 * $degree) ;++
    Penta_Plexity($length, $depth, $dir) ;F
    Turn($dir * 2 * $degree) ;++
    Penta_Plexity($length, $depth, $dir) ;F
    Case 8 ;Sierpinski Carpet
    $x1 = $width / 8
    $y1 = $height / 2
    $length = 600
    $depth = Random(2, 6, 1)
    $dir = 1
    $angle = 0
    $text = "Sierpinski Carpet, Recursion Depth = " & $depth
    Draw_Text()
    Sierpinski_Carpet($length, $depth, $dir) ;F
    Case 9 ;Gosper Curve
    $depth = Random(4, 6, 1)
    $x1 = $width / 1.45
    $y1 = $height / 7 - $depth
    $length = 480
    $dir = 1
    $angle = 0
    $text = "Gosper Curve, Recursion Depth = " & $depth
    Draw_Text()
    Gosper_R($length, $depth, $dir) ;R
    Case 10 ;Sierpinski Triangle
    $x1 = $width / 10.666
    $y1 = $height / 1.05
    $length = 325
    $depth = Random(2, 9, 1)
    $dir = 1
    $angle = 0
    $text = "Sierpinski Triangle, Recursion Depth = " & $depth
    Draw_Text()
    ;FXF--FF--FF
    Sierpinski_F($length, $depth, $dir) ;F
    Sierpinski_X($length, $depth, $dir) ;X
    Sierpinski_F($length, $depth, $dir) ;F
    Turn(-$dir * 2 * $degree) ;--
    Sierpinski_F($length, $depth, $dir) ;F
    Sierpinski_F($length, $depth, $dir) ;F
    Turn(-$dir * 2 * $degree) ;--
    Sierpinski_F($length, $depth, $dir) ;F
    Sierpinski_F($length, $depth, $dir) ;F
    Case 11 ;Pythagoras Tree
    $x1 = $width / 2
    $y1 = $height / 1.1
    $length = 110
    $depth = Random(5, 15, 1)
    $dir = 1
    $angle = 5
    $text = "Pythagoras Tree, Recursion Depth = " & $depth
    Draw_Text()
    Pythagoras($length, $depth, $dir)
    EndSwitch
    $random += 1
    If $random = 12 Then $random = 1
    Sleep(4000)
    _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
    Wend

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

    Func Pythagoras($length, $split, $dir)

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    Pythagoras_Square($length)
    Else
    $dist_rel = Sqrt(3) / 2
    $degree = 30
    Pythagoras_Square($length)
    Forward_Only($length)
    Turn(-$dir * 1 * $degree)
    Pythagoras($length * $dist_rel, $split - 1, 1)
    Turn($dir * 3 * $degree)
    Forward_Only($length * $dist_rel)
    Pythagoras($length / 2, $split - 1, 1)
    Forward_Only(-$length * $dist_rel)
    Turn(-$dir * 2 * $degree)
    Forward_Only(-$length)
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Pythagoras_Square($length)
    Local $i
    For $i = 1 To 4
    Draw_and_Forward($length)
    Turn($dir * 90)
    Next
    EndFunc

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

    Func Sierpinski_X($length, $split, $dir)
    ;FXF--FF--FF
    ;X -> --FXF++FXF++FXF--
    ;F -> FF

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    ;~ Draw_and_Forward($length)
    Else
    $dist_rel = 2
    $degree = 60
    Turn(-$dir * 2 * $degree) ;--
    Sierpinski_F($length / $dist_rel, $split - 1, 1) ;F
    Sierpinski_X($length / $dist_rel, $split - 1, 1) ;X
    Sierpinski_F($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * 2 * $degree) ;++
    Sierpinski_F($length / $dist_rel, $split - 1, 1) ;F
    Sierpinski_X($length / $dist_rel, $split - 1, 1) ;X
    Sierpinski_F($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * 2 * $degree) ;++
    Sierpinski_F($length / $dist_rel, $split - 1, 1) ;F
    Sierpinski_X($length / $dist_rel, $split - 1, 1) ;X
    Sierpinski_F($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * 2 * $degree) ;--
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Sierpinski_F($length, $split, $dir)
    ;FXF--FF--FF
    ;X -> --FXF++FXF++FXF--
    ;F -> FF

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    Draw_and_Forward($length)
    Else
    $dist_rel = 2
    $degree = 60
    Sierpinski_F($length / $dist_rel, $split - 1, 1) ;F
    Sierpinski_F($length / $dist_rel, $split - 1, 1) ;F
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Gosper_R($length, $split, $dir)
    ;F -> R or F -> L
    ;R -> R+L++L-R--RR-L+
    ;L -> -R+LL++L+R--R-L

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    Draw_and_Forward($length)
    Else
    $dist_rel = Sqrt(7)
    $degree = 60
    Gosper_R($length / $dist_rel, $split - 1, 1) ;R
    Turn($dir * 1 * $degree) ;+
    Gosper_L($length / $dist_rel, $split - 1, 1) ;L
    Turn($dir * 2 * $degree) ;++
    Gosper_L($length / $dist_rel, $split - 1, 1) ;L
    Turn(-$dir * 1 * $degree) ;-
    Gosper_R($length / $dist_rel, $split - 1, 1) ;R
    Turn(-$dir * 2 * $degree) ;--
    Gosper_R($length / $dist_rel, $split - 1, 1) ;R
    Gosper_R($length / $dist_rel, $split - 1, 1) ;R
    Turn(-$dir * 1 * $degree) ;-
    Gosper_L($length / $dist_rel, $split - 1, 1) ;L
    Turn($dir * 1 * $degree) ;+
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Gosper_L($length, $split, $dir)
    ;F -> R or F -> L
    ;R -> R+L++L-R--RR-L+
    ;L -> -R+LL++L+R--R-L

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    Draw_and_Forward($length)
    Else
    $dist_rel = Sqrt(7)
    $degree = 60
    Turn(-$dir * 1 * $degree) ;-
    Gosper_R($length / $dist_rel, $split - 1, 1) ;R
    Turn($dir * 1 * $degree) ;+
    Gosper_L($length / $dist_rel, $split - 1, 1) ;L
    Gosper_L($length / $dist_rel, $split - 1, 1) ;L
    Turn($dir * 2 * $degree) ;++
    Gosper_L($length / $dist_rel, $split - 1, 1) ;L
    Turn($dir * 1 * $degree) ;+
    Gosper_R($length / $dist_rel, $split - 1, 1) ;R
    Turn(-$dir * 2 * $degree) ;--
    Gosper_R($length / $dist_rel, $split - 1, 1) ;R
    Turn(-$dir * 1 * $degree) ;-
    Gosper_L($length / $dist_rel, $split - 1, 1) ;L
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Sierpinski_Carpet($length, $split, $dir)
    ;F
    ;F -> F+F-F-FF-F-F-fF
    ;f -> fff

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    Draw_and_Forward($length)
    Else
    $dist_rel = 3
    $degree = 90
    Sierpinski_Carpet($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * 1 * $degree) ;+
    Sierpinski_Carpet($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * 1 * $degree) ;-
    Sierpinski_Carpet($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * 1 * $degree) ;-
    Sierpinski_Carpet($length / $dist_rel, $split - 1, 1) ;F
    Sierpinski_Carpet($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * 1 * $degree) ;-
    Sierpinski_Carpet($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * 1 * $degree) ;-
    Sierpinski_Carpet($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * 1 * $degree) ;-
    Sierpinski_Carpet_Forward_Only($length / $dist_rel, $split - 1, 1) ;f
    Sierpinski_Carpet($length / $dist_rel, $split - 1, 1) ;F
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Sierpinski_Carpet_Forward_Only($length, $split, $dir) ;f
    ;F
    ;F -> F+F-F-FF-F-F-fF
    ;f -> fff
    Forward_Only($length / $dist_rel) ;f
    Forward_Only($length / $dist_rel) ;f
    Forward_Only($length / $dist_rel) ;f
    ;Sleep(0)
    EndFunc

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

    Func Penta_Plexity($length, $split, $dir)
    ;F++F++F++F++F
    ;F -> F++F++F|F-F++F

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    Draw_and_Forward($length)
    Else
    $dist_rel = ((Sqrt(5) + 1) / 2)^2
    $degree = 36
    Penta_Plexity($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * 2 * $degree) ;++
    Penta_Plexity($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * 2 * $degree) ;++
    Penta_Plexity($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * 5 * $degree) ;180°
    Penta_Plexity($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * 1 * $degree) ;-
    Penta_Plexity($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * 2 * $degree) ;++
    Penta_Plexity($length / $dist_rel, $split - 1, 1) ;F
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Arrowhead_R($length, $split, $dir)
    ;F -> R oder F -> L
    ;R -> -L+R+L-
    ;L -> +R-L-R+

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    Draw_and_Forward($length)
    Else
    $dist_rel = 2
    $degree = 60
    Turn(-$dir * 1 * $degree) ;-
    Arrowhead_L($length / $dist_rel, $split - 1, 1) ;L
    Turn($dir * 1 * $degree) ;+
    Arrowhead_R($length / $dist_rel, $split - 1, 1) ;R
    Turn($dir * 1 * $degree) ;+
    Arrowhead_L($length / $dist_rel, $split - 1, 1) ;L
    Turn(-$dir * 1 * $degree) ;--
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Arrowhead_L($length, $split, $dir)
    ;F -> R oder F -> L
    ;R -> -L+R+L-
    ;L -> +R-L-R+

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    Draw_and_Forward($length)
    Else
    $dist_rel = 2
    $degree = 60
    Turn($dir * 1 * $degree) ;+
    Arrowhead_R($length / $dist_rel, $split - 1, 1) ;R
    Turn(-$dir * 1 * $degree) ;-
    Arrowhead_L($length / $dist_rel, $split - 1, 1) ;L
    Turn(-$dir * 1 * $degree) ;-
    Arrowhead_R($length / $dist_rel, $split - 1, 1) ;R
    Turn($dir * 1 * $degree) ;+
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Triangle($length, $split, $dir)
    ;F--F--F
    ;F -> F--F--F--ff
    ;ff -> ff

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    Draw_and_Forward($length)
    Else
    $dist_rel = 2
    $degree = 60
    Triangle($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * 2 * $degree) ;--
    Triangle($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * 2 * $degree) ;--
    Triangle($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * 2 * $degree) ;--
    Forward_Only($length / $dist_rel) ;f
    Forward_Only($length / $dist_rel) ;f
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Dragon($length, $split, $dir)
    ;F -> R
    ;R -> +R--L+
    ;L -> -R++L-

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    Draw_and_Forward($length)
    Else
    $degree = 45
    $dist_rel = Sqrt(2)
    Turn($dir * $degree) ;+
    Dragon($length / $dist_rel, $split - 1, 1) ;R
    Turn(-$dir * 2 * $degree) ;--
    Dragon($length / $dist_rel, $split - 1, -1) ;L
    Turn($dir * $degree) ;+
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Levy_C($length, $split, $dir)
    ;F
    ;F -> +F--F+

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    Draw_and_Forward($length)
    Else
    $degree = 45
    $dist_rel = 1.45
    Turn($dir * $degree) ;+
    Levy_C($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * 2 * $degree) ;--
    Levy_C($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * $degree) ;+
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Koch($length, $split, $dir)
    ;F--F--F
    ;F -> F+F--F+F

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    Draw_and_Forward($length)
    Else
    $dist_rel = 3
    $degree = 60
    Koch($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * $degree) ;+
    Koch($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * 2 * $degree) ;--
    Koch($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * $degree) ;+
    Koch($length / $dist_rel, $split - 1, 1) ;F
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Peano($length, $split, $dir)
    ;F
    ;F -> F-F+F+F+F-F-F-F+F

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

    If _IsPressed("20", $dll) Then ;hold pressed spacebar to abort current drawing
    $split = 0
    $dir = 0
    $length = 0
    EndIf
    If $split = 0 Then
    Draw_and_Forward($length)
    Else
    $dist_rel = 3
    $degree = 90
    Peano($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * $degree) ;-
    Peano($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * $degree) ;+
    Peano($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * $degree) ;+
    Peano($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * $degree) ;+
    Peano($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * $degree) ;-
    Peano($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * $degree) ;-
    Peano($length / $dist_rel, $split - 1, 1) ;F
    Turn(-$dir * $degree) ;-
    Peano($length / $dist_rel, $split - 1, 1) ;F
    Turn($dir * $degree) ;+
    Peano($length / $dist_rel, $split - 1, 1) ;F
    EndIf
    ;Sleep(0)
    EndFunc

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

    Func Turn ($degrees)
    $angle = $angle + ($degrees * $Pi_Div_180)
    EndFunc

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

    Func Draw_and_Forward($length)
    $x2 = $x1 + Cos($angle) * $length
    $y2 = $y1 + Sin($angle) * $length
    ;~ Local $red = 0 ;((Cos(1 * $x1 / 2^6) + 1) / 2) * 256
    ;~ Local $green = 0;((Cos(1.25 * $y2 / 2^6) + 1) / 2) * 256
    ;~ Local $blue = 0;((Cos(1.5 * $x2 / 2^6) + 1) / 2) * 256
    ;~ _GDIPlus_PenSetColor($Pen, "0xEF" & Hex($red, 2) & Hex($green, 2) & Hex($blue, 2)) ;Set the pen color
    _GDIPlus_PenSetColor($Pen, "0x60000000") ;Set the pen color
    _GDIPlus_GraphicsDrawLine($hGraphic, $x1, $y1, $x2, $y2, $Pen)
    $x1 = $x2
    $y1 = $y2
    EndFunc

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

    Func Forward_Only($length)
    $x2 = $x1 + Cos($angle) * $length
    $y2 = $y1 + Sin($angle) * $length
    $x1 = $x2
    $y1 = $y2
    EndFunc

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

    Func Draw_Text()
    Local $Text_Layout2
    Local $text_info = "UEZ 2009 ;-)"
    $Text_Layout = _GDIPlus_RectFCreate (0, $height - 1.75 * $font_size, 0, 0)
    $Text_Layout2 = _GDIPlus_RectFCreate ($width - StringLen($text_info) * $font_size * 0.67, $height - 1.75 * $font_size, 0, 0)
    _GDIPlus_GraphicsDrawStringEx ($hGraphic, $text, $Font, $Text_Layout, $String_Format, $Brush)
    _GDIPlus_GraphicsDrawStringEx ($hGraphic, $text_info, $Font, $Text_Layout2, $String_Format, $Brush)
    EndFunc

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

    Func Save_PIC()
    If _IsPressed("78", $dll) Then
    _GDIPlus_Save_to_Image(@ScriptDir & "\L-SF-Screenshot_" & @YEAR & @MON & @MDAY & "_" & @HOUR & @MIN & @SEC, $hGUI)
    If @error Then MsgBox(16, "ERROR", "Image was not saved!", 10)
    EndIf
    EndFunc

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

    ; #FUNCTION# =============================================================================
    ; Name...........: _GDIPlus_Save_to_Image
    ; Description ...: INTERNAL FUNCTION - save drawn image to file
    ; Syntax.........: _GraphGDIPlus_Reference_Pixel($file, $hWnd)
    ; Parameters ....: $file - filename
    ; $hWnd - handle to GUI
    ; Autor .........: ptrex, ProgAndy, UEZ
    ; =========================================================================================
    Func _GDIPlus_Save_to_Image($file, $hWnd, $CLSID = "PNG")
    Local $hDC, $memBmp, $memDC, $hImage, $w, $h, $size, $sCLSID
    If $file <> "" Or $hWnd <> "" Then
    $size = WinGetClientSize($hWnd)
    $w = $size[0]
    $h = $size[1]
    $hDC = _WinAPI_GetDC($hWnd)
    $memDC = _WinAPI_CreateCompatibleDC($hDC)
    $memBmp = _WinAPI_CreateCompatibleBitmap($hDC, $w, $h)
    _WinAPI_SelectObject ($memDC, $memBmp)
    _WinAPI_BitBlt($memDC, 0, 0, $w, $h, $hDC, 0, 0, 0x00CC0020) ; 0x00CC0020 = $SRCCOPY
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP ($memBmp)
    $sCLSID = _GDIPlus_EncodersGetCLSID ($CLSID)
    ;~ _GDIPlus_ImageSaveToFile($hImage, $file)
    _GDIPlus_ImageSaveToFileEx ($hImage, $file & "." & StringLower($CLSID), $sCLSID)
    If @error Then
    Return SetError(1, 0, 0)
    Else
    Return SetError(0, 0, 0)
    EndIf
    _GDIPlus_ImageDispose ($hImage)
    _WinAPI_ReleaseDC($hWnd, $hDC)
    _WinAPI_DeleteDC($memDC)
    _WinAPI_DeleteObject ($memBmp)
    Else
    Return SetError(1, 0, 0)
    EndIf
    EndFunc

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

    Func _Exit()
    AdlibUnRegister("Save_PIC")
    ; Clean up resources
    _GDIPlus_PenDispose($Pen)
    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_FontDispose ($Font)
    _GDIPlus_FontFamilyDispose ($Font_Family)
    _GDIPlus_StringFormatDispose ($String_Format)
    _GDIPlus_BrushDispose($Brush)
    _GDIPlus_Shutdown ()
    DllClose($dll)
    Exit
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Another AutoIt PreProcessor

    • UEZ
    • 7. Februar 2010 um 12:59

    Das Programm gefällt mir sehr gut - super Code! :thumbup:

    Kannst du noch eine Commandline mit einbauen, damit man den Pre-Prozessor aus SciTE aufrufen kann? Ein Button, um den "PreProcessed" Code zu Testzwecken auszuführen, wäre auch nett!

    Ach ja, diese Farben gefallem mir besser -> Global $iColorBk = 0xE0E0E0, $iColor1 = 0x198A00, $iColor2 = 0xCA7F00, $iColor3 = 0x1964EA, $iColor4 = 0x644B4B, $iColor5 = 0x1919FA


    Ich werde weiteren Code testen und bei Problemen mich wieder melden ;)

    Danke,
    UEZ

  • Physik Engine Version2

    • UEZ
    • 6. Februar 2010 um 20:51

    Mein GDI+ Beitrag dazu ist im Vergleich zu den Berechnungen eher nebensächlich!

    Hut ab! :thumbup:

    UEZ

  • Physik Engine Projekt

    • UEZ
    • 4. Februar 2010 um 22:10
    Zitat von moritz1243

    Hiiiiiiiiiiiiiiiiiiiijjjjjjjjjjjjjjaaaaaaaaaaaaaaaa, das wäre mega schwer und autoit ist für 3D zulangsam, außerdem bin ich gar nicht schlau genug dafür- sry aber das ist echt unmöglich. Ich habe schonmal versucht eine 3D engine mit autoit zu schreiben die konnte einen würfel anzeigen, aber viel mehr ist echt nicht möglich. Worm 2D wäre höchtes möglich.
    Ich hatte auch vor mein Autoball script upzudaten, mal schauen.

    grüße Moritz

    Schlau genug bist du, aber AutoIt mit GDI+ wäre da viel zu langsam ;)

    UEZ

  • Mit GDIPlus Um Punkt Drehen

    • UEZ
    • 31. Januar 2010 um 15:58

    Meinst du den Zeiger gegen den Uhrzeiger? Wenn ja, dann einfach die Zeile in $i += 1 editieren!

    Gruß,
    UEZ

  • vertical_label UDF

    • UEZ
    • 29. Januar 2010 um 18:49

    Schaue dir das mal an von BugFix: http://www.autoitscript.com/forum/index.php?showtopic=93402&view=findpost&p=671084

    ;)
    Gruß,
    UEZ

  • Play Chip Sound from Memory

    • UEZ
    • 29. Januar 2010 um 10:13
    Zitat von AutoBert

    Halo UEZ,

    ich kann zwar nicht komponieren, aber mein Netbook liefert mit Hilfe deines Tools nette Hintergrundmusik:
    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.
    Aufgenommen habe ich das ganze mit dem Audio Recorder von eukalyptus.
    Ich hatte eigentlich irgenwelche chaotische, disharmonische Geräusche erwartet, aber das ganze klingt melodiös,

    mfg (Auto)Bert

    Das rhytmische Geklicke im Hintergrund ist auch auf meinem Notebook zu hören! keine Ahnung woran das liegt - vielleicht an der FDMOD.DLL, denn mit BASSMOD.DLL höre ich auch die "Hintergrundgeräusche"! Vielleicht können diese Instrumente nicht richtig abgespielt werden!

    Mit KMPlayer hört sich das besser an!

    Gruß,
    UEZ

  • Rekursive Dateisuche

    • UEZ
    • 28. Januar 2010 um 19:49

    Yep, hast recht - ist ein Bug:

    Hier die Version, die richtig funktionieren sollte:

    Spoiler anzeigen
    [autoit]


    #include <Array.au3>
    Dim $ergebnis[1]

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

    $path = @WindowsDir
    $file = ".log"
    ;~ $ergebnis = File_Seeker($path, $file, $ergebnis, False, True) ;searchs for ".log" (exact search)
    $ergebnis = File_Seeker($path, $file, $ergebnis) ;searchs for "*.log"
    ;~ $ergebnis = File_Seeker($path, $file, $ergebnis, True) ;searchs for files with extension .log

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

    If Not @error Then
    ;~ _ArraySort($ergebnis)
    ;~ _ArrayDisplay($ergebnis)
    Local $log
    For $i = 1 To UBound($ergebnis) - 1
    $log &= $ergebnis[$i] & @CRLF
    Next
    $file = FileOpen(@ScriptDir & "\Ergebnis.log", 1)
    FileWrite($file, $log)
    FileClose($file)
    EndIf

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

    Exit

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

    ;==================================================================================================
    ; Function Name: File_Seeker($path, $file, $array)
    ; Description: searchs for a file recursively on given drive
    ; Parameter(s): $path path where to search
    ; $file filename to search for
    ; $array to save the search results
    ; $ext search for file extension, e.g. .mp3
    ; $exact to search for exact file name (not case sensitive)
    ; Return Value(s): an array with the full path of the files, $array[0] = amount of found files
    ; Version: v0.80 Build 2010-01-28 Beta
    ; Author(s): UEZ
    ;==================================================================================================
    Func File_Seeker($path, $file, ByRef $aResults, $ext = False, $exact = False)
    If $file <> "" And IsArray($aResults) And BitAND($ext, $exact) <> 1 Then
    If StringRegExp(StringLeft($path, 1), "[a-zA-Z]") And StringMid($path, 2, 1) = ":" Then
    If StringRight($path, 1) <> "\" Then $path &= "\"
    Local $seek, $suffix = ""
    Local $search = FileFindFirstFile($path & "*")
    If $search = -1 Then
    SetError(2)
    Return
    EndIf
    While 1
    $seek = FileFindNextFile($search)
    If @error Then ExitLoop
    If @extended Then File_Seeker($path & $seek & "\", $file, $aResults, $ext, $exact)
    If $exact And Not $ext Then
    If $seek = $file Then _ArrayAdd($aResults, $path & $seek)
    Else
    If $ext Then
    If StringRegExp($seek, "(?i:\" & $file & "+$\b)") And StringLeft($file, 1) = "." Then _ArrayAdd($aResults, $path & $seek)
    Else
    If StringRegExp($seek, "(?i:" & $file & ")+") Then _ArrayAdd($aResults, $path & $seek)
    EndIf
    EndIf
    WEnd
    FileClose($search)
    $aResults[0] = UBound($aResults) - 1
    SetError(0)
    Return $aResults
    Else
    SetError(1)
    Return
    EndIf
    Else
    SetError(1)
    Return
    EndIf
    EndFunc

    [/autoit]

    Bitte testen und Feedback!

    Danke,

    UEZ

  • Rekursive Dateisuche

    • UEZ
    • 28. Januar 2010 um 16:26
    Zitat von Silverlight

    Da öffnet sich dann aber noch eine GUI *heul* geht es auch ohne :)?
    Ansonsten perfekt werde es testen.

    Einfach die Zeile 11 auskommentieren -> ;_ArrayDisplay($ergebnis)

    Gruß,
    UEZ

  • Rekursive Dateisuche

    • UEZ
    • 28. Januar 2010 um 15:37
    Spoiler anzeigen
    [autoit]


    #include <Array.au3>
    Dim $ergebnis[1]

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

    $path = "c:\"
    $file = ".mp3" ;suche nach *.mp3

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

    $ergebnis = File_Seeker($path, $file, $ergebnis, True)

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

    If Not @error Then
    ;~ _ArraySort($ergebnis)
    _ArrayDisplay($ergebnis)
    Local $log
    For $i = 1 To UBound($ergebnis) - 1
    $log &= $ergebnis[$i] & @CRLF
    Next
    $file = FileOpen(@ScriptDir & "\Ergebnis.log", 1)
    FileWrite($file, $log) ;schreibe das Ergebnis in die "Ergebnis.log" Datei
    FileClose($file)
    EndIf

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

    Exit

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

    ;==================================================================================================
    ; Function Name: File_Seeker($path, $file, $array)
    ; Description: searchs for a file recursively on given drive
    ; Parameter(s): $path path where to search
    ; $file filename to search for
    ; $array to save the search results
    ; $ext search for file extension, e.g. .mp3
    ; $exact to search for exact file name (not case sensitive)
    ; Return Value(s): an array with the full path of the files, $array[0] = amount of found files
    ; Version: v0.75 Build 2010-01-18 Beta
    ; Author(s): UEZ
    ;==================================================================================================
    Func File_Seeker($path, $file, ByRef $aResults, $ext = False, $exact = False)
    If $file <> "" And IsArray($aResults) Then
    If StringRegExp(StringLeft($path, 1), "[a-zA-Z]") And StringMid($path, 2, 1) = ":" Then
    If StringRight($path, 1) <> "\" Then $path &= "\"
    Local $seek, $suffix = ""
    Local $search = FileFindFirstFile($path & "*")
    If $search = -1 Then
    SetError(2)
    Return
    EndIf
    While 1
    $seek = FileFindNextFile($search)
    If @error Then ExitLoop
    If @extended Then File_Seeker($path & $seek & "\", $file, $aResults, $ext, $exact)
    If $exact Then
    If $seek = $file Then _ArrayAdd($aResults, $path & $seek)
    Else
    If $ext Then $suffix = "$"
    If StringRegExp($seek, "(?i:\" & $file & $suffix & "\b)") Then _ArrayAdd($aResults, $path & $seek)
    EndIf
    WEnd
    FileClose($search)
    $aResults[0] = UBound($aResults) - 1
    SetError(0)
    Return $aResults
    Else
    SetError(1)
    Return
    EndIf
    Else
    SetError(1)
    Return
    EndIf
    EndFunc

    [/autoit]


    Gruß,
    UEZ

  • Rekursive Dateisuche

    • UEZ
    • 28. Januar 2010 um 15:17
    Zitat von Silverlight

    Ok aber wo gibt er das Ergebnis aus?

    Das Ergebnis wird in ein Array gespeichert und nur angezeigt.

    Das Schreiben des Ergebnisses in eine Datei ist nicht implementiert, da ich nicht weiß, was die Leute mit dem Ergebniss machen wollen!

    Gruß,
    UEZ

  • Play Chip Sound from Memory

    • UEZ
    • 28. Januar 2010 um 15:07
    Zitat von progandy


    MemoryDLL selbst sollte auch unter x64 laufen. Nur die FMOD.dll nicht. Was passiert denn, wenn du als AutoIt x86 ausführst?

    Die compilierte x86 exe unter Win7 x64 läuft, aber nicht, wenn du es native x64 laufen lässt. Ob das jetzt and der FMOD.DLL oder and MemoryDLL.au3 liegt, habe ich nicht direkt getestet, sondern nur vermutet, da die FMOD.DLL ja nicht x64 Code enthält, aber von dem AutoIt Code im x64 Mode ausgeführt wird.
    Die compilierte x64 läuft auch nicht!

    Gruß,
    UEZ

  • Rekursive Dateisuche

    • UEZ
    • 28. Januar 2010 um 14:58
    Zitat von Silverlight

    Oscar wie lasse ich mir den die gefunden Pfade + Dateien in einer txt Datei wieder geben?
    Ich denke mal mit

    [autoit]

    _ArrayDisplay($aReturn, 'Alle Dateien mit der Erweiterung ".au3"')

    [/autoit]

    aber wo werden sie gespeichert?

    UEZ dein Programm sucht aber nur nach einer Datei?

    Nein, nach den Dateien, die ins Suchmuster passen. Im Beispiel nach *.log Dateien.

    Gruß,
    UEZ

  • Rekursive Dateisuche

    • UEZ
    • 28. Januar 2010 um 14:09

    Auch eins von mir -> File_Seeker v0.75 Build 2010-01-18 Beta (Schleichwerbung).

    Kannst ja mal testen und Feedback geben, ob das Proggy richtig läuft!

    Gruß,
    UEZ

  • Play Chip Sound from Memory

    • UEZ
    • 28. Januar 2010 um 00:08

    MemoryDLL.au3 läuft anscheinend nur unter x32! :(

    Gruß,
    UEZ

  • Play Chip Sound from Memory

    • UEZ
    • 27. Januar 2010 um 23:56

    Hier eine Demo, wie man ein Chip Sound (FastTracker Mods) direkt vom Speicher abspielt!

    Da der Source Code recht groß ist, nur als Anhang! :huh:

    Benutzt wurden

    • FMOD.au3 in einer von mir modifizierten Version
    • FMOD.DLL
    • MemoryDLL.au3
    • 3 Sounds :rock:

    Gruß,
    UEZ

    PS: Source Code scheint nur als x86 zu laufen!

    Dateien

    Play MP3 from mem using FMOD.au3 1,85 MB – 1.649 Downloads FMod Memory Play Example.au3 1,13 MB – 1.137 Downloads
  • gdi plus

    • UEZ
    • 27. Januar 2010 um 22:34

    Nun ja, da habe ich fast dein Skript geschrieben...

    Spoiler anzeigen
    [autoit]


    ;===================================================================================================
    ; INRadio-Localtuner by JuraX
    ;===================================================================================================

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

    #NoTrayIcon
    #include "Bass.au3"
    ;~ #include <BassConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiListView.au3>
    #include <ListViewConstants.au3>
    #Include <Misc.au3>
    #include <Sound.au3>
    #include <WindowsConstants.au3>
    #include <GDIplus.au3>

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

    Opt("MouseCoordMode", 0)
    #Region StartUp
    Local $progress_slider, $slots, $hwnd
    Global $gaDropFiles[1]
    Global Const $WM_DROPFILES = 0x0233
    Global $playing_state = -1
    Global $aItem[2]

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

    ;First Start
    ;~ $firststart = IniRead("INRadio.ini", "Start", "firststart", "")
    ;~ If $firststart = "" Then
    ;~ MsgBox(0, "Warnung!", "Bitte über den Radiotuner Starten!")
    ;~ Exit
    ;~ ElseIf ProcessExists("Radiotuner.exe") Then
    ;~ Else
    ;~ MsgBox(0, "Warnung!", "Bitte über den Radiotuner Starten!")
    ;~ Exit
    ;~ EndIf

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

    ;Bass StartUp
    _BASS_STARTUP(@ScriptDir & "\BASS.dll")
    _BASS_Init(0, -1, 44100, 0, "")
    If @error Then
    MsgBox(0, "Error", "Sound konnte nicht Initialisiert werden!")
    Exit
    EndIf

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

    ;File Open
    $file = FileOpenDialog("Open...", "", "MP3 Files (*.mp3)")
    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    $song_length = _BASS_ChannelGetLength($MusicHandle, $BASS_POS_BYTE)
    If @error Then
    MsgBox(0, "Error", "Konnte Audiodatei nicht laden!" & @CR & "Error = " & @error)
    Exit
    EndIf
    $fftstruct = DllStructCreate("float[128]")
    _BASS_ChannelPlay($MusicHandle, 0)
    $playing_state = 1
    #EndRegion StartUp

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

    #Region GUI
    $width = 380
    $height = 650
    $hwnd = GUICreate("INRadio-Localtuner", $width, $height, -1, -1, Default, $WS_EX_ACCEPTFILES)
    $Close = GUICtrlCreateButton("Close", 296, 160, 75, 25, 0)
    $Play = GUICtrlCreateButton("Play", 216, 160, 75, 25, 0)
    $Stop = GUICtrlCreateButton("Stop", 136, 160, 75, 25, 0)
    $newfile = GUICtrlCreateButton("Andere Datei", 36, 160, 75, 25, 0)
    $progress_slider = GUICtrlCreateProgress(8, 32, 236, 20)
    $slots = GUICtrlCreateLabel(GUICtrlRead($progress_slider) & "%", 8, 8, 150, 17)
    ;GUICtrlCreateLabel("Fortschritt", 8, 8, 150, 17)

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

    GUICtrlCreateLabel("Lautstärke", 8, 190, 80, 20)
    $Volume_slider1 = GUICtrlCreateSlider(8, 210, 366, 80)
    GUICtrlSetData($Volume_slider1, 50)
    GUICtrlSetLimit(-1, 100, 0)
    $Volume_slider2 = GUICtrlCreateSlider(8, 292, 366, 80)
    GUICtrlSetData($Volume_slider2, 50)
    GUICtrlSetLimit(-1, 100, 0)

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

    $hListView = GUICtrlCreateListView('Dateiname|Pfad', 10, 375, 350, 200)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)
    GUIRegisterMsg($WM_DROPFILES, 'WM_DROPFILES_FUNC')
    WinSetOnTop($hwnd, '', 1)

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

    $rightVol = GUICtrlCreateProgress(8, 88, 236, 17)
    GUICtrlSetLimit(-1, 100, 0)
    GUICtrlCreateLabel("Right Channel Volume Level", 8, 112, 150, 17)
    $LeftVol = GUICtrlCreateProgress(8, 136, 236, 17)
    GUICtrlSetLimit(-1, 100, 0)
    GUICtrlCreateLabel("Left Channel Volume Level", 8, 64, 150, 17)

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

    GUISetState(@SW_SHOW)
    #EndRegion GUI

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

    GUICtrlCreateListViewItem(StringRegExpReplace($file, '.*\\(.*)\..*', '$1')& "|" & $file, $hListView)
    _GUICtrlListView_SetColumnWidth($hListView, 0, $LVSCW_AUTOSIZE)

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

    _GDIPlus_Startup()
    $iX = 120
    $iY = 145
    $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics($iX, $iY, $graphics)
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
    _GDIPlus_GraphicsClear($backbuffer)
    $pen1_size = 4
    $pen1 = _GDIPlus_PenCreate(0, $pen1_size)
    $pen2_size = 4
    $pen2 = _GDIPlus_PenCreate(0, $pen2_size)
    $pen3_size = 3
    $pen3 = _GDIPlus_PenCreate(0, $pen3_size)

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

    $fall_speed_l_threshold = 0
    $fall_speed_r_threshold = 0
    $equalizer_width = 24
    $max_l = 0
    $max_r = 0
    $fall_speed = 5
    $fire_up = 15

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

    $fft_start = 7
    $fft_end = 127
    $fft_boost = 750
    $dy = Int($iY / ($fft_end - $fft_start)) + $pen3_size
    $dyy = Int($iY / $dy / 2)
    $eq = -1
    Dim $mpos[2]
    ;Sonstiges
    AdlibRegister("Aktualisieren", 100)
    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

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

    #Region Loop
    While 1 * Sleep(20)
    If $playing_state = 1 Then
    $current = _BASS_ChannelGetPosition($MusicHandle, $BASS_POS_BYTE)
    $percent = Round(($current / $song_length) * 100, 0)
    GUICtrlSetData($progress_slider, $percent)
    $levels = _BASS_ChannelGetLevel($MusicHandle)
    $rightChLvl = _LoWord($levels)
    $rightChLvlper = Round(($rightChLvl / 32768) * 100, 0)
    $LeftChLvl = _HiWord($levels)
    $leftChLvlper = Round(($LeftChLvl / 32768) * 100, 0)
    Else
    $rightChLvlper = 0
    $leftChLvlper = 0
    EndIf
    GUICtrlSetData($rightVol, $rightChLvlper)
    GUICtrlSetData($LeftVol, $leftChLvlper)
    Display_Vis($eq)
    $Msg = GUIGetMsg()
    Switch $Msg
    Case $GUI_EVENT_CLOSE, $Close
    _BASS_Stop()
    _BASS_Free()
    ProcessClose("Radiotuner.exe")
    AdlibUnRegister("Aktualisieren")
    _GDIPlus_PenDispose($pen1)
    _GDIPlus_PenDispose($pen2)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_GraphicsDispose($graphics)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_Shutdown()
    $fftstruct = 0
    Exit
    Case $Play
    _BASS_ChannelPlay($MusicHandle, 1)
    $playing_state = 1
    Case $newfile
    _BASS_ChannelStop($MusicHandle)
    $file = FileOpenDialog("Open...", "", "MP3 Files (*.mp3)")
    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelPlay($MusicHandle, 0)
    Case $Volume_slider1
    _BASS_SetVolume(GUICtrlRead($Volume_slider1) / 100)
    Case $Volume_slider2
    SoundSetWaveVolume(GUICtrlRead($Volume_slider2))
    Case $Stop
    _BASS_ChannelStop($MusicHandle)
    $playing_state = -1
    EndSwitch
    $mpos = MouseGetPos()
    If $mpos[0]>= $width - $iX - 10 And $mpos[0] <= $width - 10 And $mpos[1] > 8 And $mpos[1] <= $iY + 8 And _IsPressed("01", "user32.dll") And WinActive($hwnd) Then
    $eq *= -1
    EndIf
    WEnd
    #EndRegion Loop

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

    #Region Func's
    Func OnAutoItExit()
    ; _BASS_Free()
    EndFunc ;==>OnAutoItExit

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

    Func WM_DROPFILES_FUNC($hWnd, $msgID, $wParam, $lParam) ; diese Funktion wird benötigt, damit man auch mehrere Dateien droppen kann
    Local $nSize, $pFileName ; Original von UEZ http://www.autoit.de/index.php?page…4119#post134119
    Local $nAmt = DllCall('shell32.dll', 'int', 'DragQueryFileW', 'hwnd', $wParam, 'int', 0xFFFFFFFF, 'ptr', 0, 'int', 255)

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

    For $i = 0 To $nAmt[0]
    $nSize = DllCall('shell32.dll', 'int', 'DragQueryFileW', 'hwnd', $wParam, 'int', $i, 'ptr', 0, 'int', 0)
    $nSize = $nSize[0] + 1
    $pFileName = DllStructCreate('wchar[' & $nSize & ']')
    DllCall('shell32.dll', 'int', 'DragQueryFileW', 'hwnd', $wParam, 'int', $i, 'ptr', DllStructGetPtr($pFileName), 'int', $nSize)
    $filename = DllStructGetData($pFileName, 1) ;Dateinamen holen
    ConsoleWrite($filename & @CRLF)
    ReDim $gaDropFiles[$i + 1]
    $gaDropFiles[$i] = $filename
    $pFileName = 0
    Next
    ;_ArrayDisplay($gaDropFiles)
    For $i = 0 To UBound($gaDropFiles) - 2 ;kommt derzeit immer noch ein leerer Eintrag am schluss
    GUICtrlCreateListViewItem(StringRegExpReplace($gaDropFiles[$i], '.*\\(.*)\..*', '$1')& "|" & $gaDropFiles[$i], $hListView)
    Next
    _GUICtrlListView_SetColumnWidth($hListView, 0, $LVSCW_AUTOSIZE) ;erst wenn alle eigefügt sind
    EndFunc ;==>WM_DROPFILES_FUNC

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

    Func Aktualisieren()
    $Sliderstatus = GUICtrlRead($progress_slider)
    GUICtrlSetData($slots, $Sliderstatus)
    EndFunc ;==>Aktualisieren

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

    Func WM_NOTIFY($hWnd, $MsgID, $wParam, $lParam);<================== Benachrichtigung Doppelklick from Chaoskeks (in ChaosExecution)
    Local $tagNMHDR, $event, $hwndFrom, $code
    $tagNMHDR = DllStructCreate("int;int;int", $lParam)
    If @error Then Return 0
    $code = DllStructGetData($tagNMHDR, 3)
    If $wParam = $hListView And $code = -3 And _GUICtrlListView_GetSelectedCount($hListView) > 0 Then
    For $i = 0 To _GUICtrlListView_GetItemCount($hListView)
    IF _GUICtrlListView_GetItemSelected($hListView, $i) Then
    $aItem = _GUICtrlListView_GetItemTextArray($hlistview, $i)
    ;~ In aItem[1] steht der Dateiname und in $aItem[2] der Pfad zincl. Dateinamen
    _LeftDblClick()
    EndIf
    Next
    Endif
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_NOTIF

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

    Func _LeftDblClick()
    _BASS_ChannelStop($MusicHandle)
    $File = $aItem[2]
    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelPlay($MusicHandle, 0)
    EndFunc

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

    Func Display_Vis($eq = 1)
    _GDIPlus_GraphicsClear($backbuffer, 0x80F0F0F0)
    If $eq > 0 Then
    $levels = _BASS_ChannelGetLevel($MusicHandle)
    $LeftChLvl = $leftChLvlper ;Round(_HiWord($levels) / $iY, 0)
    $RightChLvl = $rightChLvlper ;Round(_LoWord($levels) / $iY, 0)

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

    If $max_l <= $LeftChLvl Then ;fire up higest line
    $max_l = $LeftChLvl + $fire_up
    $fall_speed_l_threshold = 20
    Else
    If $fall_speed_l_threshold <= 0 Then ;increase fall speed of highest line faster until threshold is <= 0 (second fall part)
    If $max_l > $LeftChLvl + $pen2_size * 2 Then $max_l -= $fall_speed
    Else
    $fall_speed_l_threshold -= 1 ;increase fall speed of highest line by slower until threshold is <= 0 (first fall part)
    If $max_l > $LeftChLvl + $pen2_size * 2 Then $max_l -= $fall_speed / 3
    EndIf
    EndIf

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

    If $max_r <= $RightChLvl Then
    $max_r = $RightChLvl + $fire_up
    $fall_speed_r_threshold = 20
    Else
    If $fall_speed_r_threshold <= 0 Then
    If $max_r > $RightChLvl + $pen2_size * 2 Then $max_r -= $fall_speed
    Else
    $fall_speed_r_threshold -= 1
    If $max_r > $RightChLvl + $pen2_size * 2 Then $max_r -= $fall_speed / 3
    EndIf
    EndIf

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

    _GDIPlus_PenSetColor($pen2, 0xFF505050)
    For $l = -$pen1_size - 2 To $leftChLvl Step $pen1_size * 2
    $r = $l / ($iY) * 224
    $g = 224 - $r
    $b = 0
    _GDIPlus_PenSetColor($pen1, "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2))
    _GDIPlus_GraphicsDrawLine($backbuffer, $iX / 5, $iY - $l, $iX / 5 + $equalizer_width, $iY - $l, $pen1)
    Next
    For $l = 0 To $RightChLvl
    $r = (-(Cos(1.7 * $l / 128) + 1) / 2) * 224
    $g = ((Cos(4 * $l / 256) + 1) / 2) * 224
    $b = 0
    _GDIPlus_PenSetColor($pen1, "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2))
    _GDIPlus_GraphicsDrawLine($backbuffer, 3 * $iX / 5, $iY - $l, 3 * $iX / 5 + $equalizer_width, $iY - $l, $pen1)
    Next
    _GDIPlus_GraphicsDrawLine($backbuffer, $iX / 5, $iY - $max_l, $iX / 5 + $equalizer_width, $iY - $max_l, $pen2)
    _GDIPlus_GraphicsDrawLine($backbuffer, 3 * $iX / 5, $iY - $max_r, 3 * $iX / 5 + $equalizer_width, $iY - $max_r, $pen2)
    Else
    _BASS_ChannelGetData($MusicHandle, DllStructGetPtr($fftstruct), $BASS_DATA_FFT256)
    For $i = $fft_start To $fft_end Step $dy
    $fft = Round(DllStructGetData($fftstruct, 1, $i + 1) * $fft_boost)
    $r = (-(Cos(1.7 * $fft / 256) + 1) * 0.5) * 256
    $g = ((Cos(4 * $fft / 256) + 1) * 0.5) * 256
    $b = 0
    _GDIPlus_PenSetColor($pen3, "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2))
    _GDIPlus_GraphicsDrawLine($backbuffer, $iX / 5, $i + $dyy, $iX / 5 + $fft, $i + $dyy, $pen3)
    Next
    EndIf
    _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, $width - $iX - 10, 8, $iX, $iY)
    EndFunc
    #EndRegion Func's

    [/autoit]

    Ist nur eine simple Implementierung!

    Gruß,
    UEZ

  • StringSplit und @CRLF Leerzeilen entfernen

    • UEZ
    • 26. Januar 2010 um 19:39

    Oder du kannst auch StringStripWS() benutzen (siehe Hilfe)!

    Gruß,
    UEZ

  • GDIPlus Digitaluhr

    • UEZ
    • 26. Januar 2010 um 19:37
    Zitat von xp_fan

    Sry, dass ich erst jetzt antworte!
    UEZ & Andy:Jetzt funtioniert's super :thumbup: !!!!!
    Noch eine Frage:
    Kann man die inaktiven Segmente auch ganz transparent machen, sodass man bei transparentem Hintergrund nur die Ziffern sieht?

    Ja, in dem du einfach das Zeichnen des Hintergrundes abschaltest!

    Gruß,
    UEZ

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™