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. BadBunny

Beiträge von BadBunny

  • GDI+ String ändern

    • BadBunny
    • 14. Dezember 2010 um 21:36

    Man kann mit GDI+ keine Werte ändern wie bei GGUI Controls mit GUICtrlsetdata, sondern du must es, wie du schon erkannt hast, neu malen.
    Wenn du nicht willst das alles drumherum übermalt wird, dann zeichne es neu, oder nur den Bereisch der geändert wird.
    mit _GDIPlus_GraphicsClear($hGraphics[, $iARGB = 0xFF000000])

    kannst du alles schwarz übermalen (oder die Farbe die du angibst). Wenn du ein Hintergrundbild hast nehm das als "löscher" und bau dann darauf auf.

  • allgemeine tcp frage

    • BadBunny
    • 14. Dezember 2010 um 20:22

    Ja es geht,
    zum senden musst du

    [autoit]

    TCPSend()

    [/autoit]


    Und zum annehmen

    [autoit]

    TCPRecv()

    [/autoit]


    Der Unterschied liegt nur darin, das du anders als wenn du vom Client zum Server sendest, nicht an TCPConnect sendest, sondern als Server an den Client mit TCPAccept.
    Also musst du dann :

    [autoit]


    $Listen = TCPListen("IP", 1234)
    $tcpAC= TcpAccept($Listen)
    TCPSend($tcpAC, "Sendet")

    [/autoit]
  • Dateianzahl auslesen

    • BadBunny
    • 14. Dezember 2010 um 16:59

    Um eine .txt zu schreiben musst du

    [autoit]

    FileWrite

    [/autoit]

    e verwenden.
    Das Tagesdatum bekommst du durch Makros raus. (Hilfe > Makroreferenzen)

  • Dateianzahl auslesen

    • BadBunny
    • 14. Dezember 2010 um 14:46

    Hilfe: In der UDF_Hilfe
    DirGetSize Problem:
    In einer Variabel abspeichern, diese wird dann zu einem array

  • GDI+ Graphic transparenter Hintergrund

    • BadBunny
    • 13. Dezember 2010 um 17:21

    Mehrere möglichkeiten um das zu überprüfen:
    1. Label unter das Bild legen und überprüfen ob draufgeklickt wurde (GUIGetCursorInfo )
    2. Die Koordinaten des bilder "einkesseln" und dann wieder mit GUIGetCursorInfo() überprüfen ob in den Bereich des Bildes geklickt wurde

  • Happy Birthday jonathan

    • BadBunny
    • 13. Dezember 2010 um 17:17

    Happy B-Day :party: Was soll man da großartig sagen :D

  • Probleme mit ControlClick Funktion bei Installation von IBM Client Access

    • BadBunny
    • 13. Dezember 2010 um 13:45

    Ich hab mal gehört das es möglich sein kann das über dem Control noch was liegt, mach mal controlmove mit deinen Angabebn und guck ob sich was verändert.

  • GDI+ - Neu zeichnen

    • BadBunny
    • 12. Dezember 2010 um 20:00
    Zitat

    aber leider zeichnet er auf das alte nochmals, so dass es nicht gerade Toll aussieht. Wie kann ich das verhindern?


    Man kann mit GDI+ nichts direkt "löschen", sondern nur übermalen, anders geht es nicht. Wenn du einen Hintergrund hast (z.B. weiß) zweichnest du immer das weiß wieder über das ältere Bild, aber unter das neue, ich weiß jetzt nicht wo dein Problem ist. Man merkt doch nicth das es übermalt wird, den kleinen Farbunterscheid kannst du beheben indem du die Farbe der Gui nimmst, müsste 0xf0f0f0 sein.

  • GDI+ - Neu zeichnen

    • BadBunny
    • 12. Dezember 2010 um 19:47

    So hier mal ein Bsp: (Buffer ist so groß wie Gui! Bewegung reingebracht um übermalen deutlich zu machen!)

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WIndowsConstants.au3>
    #include <GDIPlus.au3>
    #Include <Misc.au3>
    #include <Color.au3>
    #include <WinAPI.au3>
    #include <Misc.au3>

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

    Opt('MustDeclareVars', 1)

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

    Global $hGUI, $hBitmap, $hGraphic, $hBuffer, $hColorPicker
    Global $x = 0, $y = 0
    _Main()

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

    Func _Main()
    Opt("GUIOnEventMode", 1)
    $hGUI = GUICreate("GDI+ Test", 400, 400)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Events")
    GUISetOnEvent($GUI_EVENT_MINIMIZE, "_Events")
    GUISetOnEvent($GUI_EVENT_RESTORE, "_Events")

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

    GUISetOnEvent($GUI_EVENT_RESTORE, "WM_PAINT")
    GUIRegisterMsg($WM_PAINT, "WM_PAINT")

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

    GUISetState()

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

    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics(400, 400, $hGraphic)
    $hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hBuffer, 2)

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

    $hColorPicker = _GDIPlus_ImageLoadFromFile("ui-color-picker.png")

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

    _ReDraw()

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

    While 1
    Sleep(10)
    _ReDraw()
    WEnd
    EndFunc

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

    Func _ReDraw()
    _GDIPlus_GraphicsClear ($hBuffer, 0xffffff)
    _GDIPlus_GraphicsDrawImageRect($hBuffer, $hColorPicker, $x, $y, 24, 24)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, 400, 400)
    $x += 4
    If $x >= 400 Then
    $x = -24
    $y += 24
    EndIf
    EndFunc

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

    Func WM_PAINT()
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, 24, 24)
    EndFunc

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

    Func _Events()
    Select
    Case @GUI_CtrlId = $GUI_EVENT_CLOSE
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_GraphicsDispose($hBuffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_ImageDispose($hColorPicker)
    _GDIPlus_Shutdown()
    Exit
    EndSelect
    EndFunc

    [/autoit]
  • [Spiel] DropOff2

    • BadBunny
    • 12. Dezember 2010 um 15:44

    Klasse Spiel :thumbup:
    Das macht voll fun, wie wäre es mit einem Punkteranking Online? (wenns das noch nicht gibt, die Namen sind ja doch etwas... anders^^ steht ja in der txt)

  • Monopoly

    • BadBunny
    • 12. Dezember 2010 um 15:04

    Ineluki: -Pfad anpassen > Hab ich erwähnt
    -Keine Transparents > Guictrlcreatepic kann man nicht mit png Dateien machen, ansonsten müsst ichs mit GDI+ machen.
    -Man kann Schulden haben > Wenn das Geld unter 1 sinkt hat man verloren, man kann sich aber totkaufen, der Computer ABSICHTLICH nicht
    -Kl unrealistisch > Das kann man auch ändern in dem man die Vorraussetzung zum kauf erniedrigt.
    -Wenn über Los dann Geld >

    Spoiler anzeigen
    [autoit]

    If $aktuelles_feld >= 40 Then
    $aktuelles_feld -= 40
    $geld += 2000
    GUICtrlSetData($Geld_label, "Geld: " & $geld & ",-")
    EndIf

    [/autoit]

    Hatte ich drin
    -Ereignisfelder leer > Wird noch kommen

    Autoit Einstellungen im Spoiler > Scheiße, irg wie verschlampt, gefixt.

  • Monopoly

    • BadBunny
    • 12. Dezember 2010 um 12:09

    Ich hab die letzten Tage gesehen das Timiboy versucht ein Monopoly-Spiel zu schreiben und hab mich dann selber mal getestet.
    Ich bin nun fertig geworden, das Spiel enthält:


    -Einen Menschlichen Spieler
    -Einen Computer Gegner
    -Realistische Preise
    -Mietpreis ohne Haus
    -Spenden
    -Positionsanzeige
    -Benachrichtugung bei jeder Handlung des Computers und des menschlichen Spielers

    Was noch nicht drin ist:
    -Hypotheken
    -Häuser / Hotels
    -Straßen verkaufen
    -Gefängnis
    -Doppelt bei gleicher Würfelzahl
    -gesammt Geld bei Kirchenbesuch
    -Ereignisfelder

    Der Code:

    Spoiler anzeigen
    [autoit]

    ;***************CODET BY BadBunny**************autoit.de
    ;Idee von Timiboy

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

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

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

    HotKeySet("{ESC}", "_Exit")
    Func _Exit()
    Exit
    EndFunc ;==>_Exit

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

    Global $geld = 30000, $gegner_geld = 30000, $gekauft = "", $Gegner_gekauft = ""

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

    Global $felder[40][6] = [[600, 630, "Los", 0xff0000],[545, 630, "Lachnerstraße", 0xa62c2b, 1200, 40],[492, 630, "Gemeindefeld", 0xffffff],[435, 630, "Lameystraße", 0xa62c2b, 1400, 80],[382, 630, "Spende", 0xffffff, -4000],[330, 630, "Rheinau Bahnhof", 0xc0e1ce, 4000, 250],[276, 630, "Tullastraße", 0x3ec4df, 2000, 120],[220, 630, "Aktionsfeld", 0xffffff],[166, 630, "Elisabethstraße", 0x3ec4df, 2000, 120],[110, 630, "Rathenaustraße", 0x3ec4df, 2400, 160],[30, 630, "Gefängnis (Besuch)", 0xffffff], _; 11
    [30, 543, "Beethoven Straße", 0xf06ca8, 2400, 200],[30, 490, "Spende", 0xffffff, -3000],[30, 435, "Gluckstraße", 0xf06ca8, 2800, 200],[30, 380, "R.Wagner Straße", 0xf06ca8, 3200, 240],[30, 325, "Rangierbahnhof", 0xc0e1ce, 4000, 250],[30, 275, "Sophienstraße", 0xf5881f, 2400, 280],[30, 223, "Gemeindefeld", 0xffffff],[30, 170, "Viktoriastraße", 0xf5881f, 3600, 280],[30, 110, "Berlinerstraße", 0xf5881f, 4000, 320],[30, 20, "Kirchenbesuch", 0xffffff],[115, 20, "Otto-Beck-Straße", 0xe01e26, 4400, 360],[170, 20, "Aktionsfeld", 0xffffff], _ ; 23
    [225, 20, "Mollstraße", 0xe01e26, 4400, 360],[280, 20, "Augustaanlage", 0xe01e26, 4800, 400],[330, 20, "Waldhof Bahnhof", 0xc0e1ce, 4000, 250],[383, 20, "Lessingstraße", 0xf8ec1e, 2500, 440],[435, 20, "Schillerplatz", 0xf8ec1e, 2500, 440],[490, 20, "Spende", 0xffffff, -3000],[546, 20, "Goethestraße", 0xf8ec1e, 5600, 480],[625, 20, "Gehe Gefängnis", 0xffffff],[625, 113, "Leibnitzstraße", 0x0d8845, 6000, 520],[625, 165, "Kantstraße", 0x0d8845, 6000, 520],[625, 220, "Gemeindefeld", 0xffffff],[625, 275, "Spinozastraße", 0x0d8845, 6400, 560], _ ; 35
    [625, 330, "Hauptbahnhof", 0xc0e1ce, 4000, 250],[625, 380, "Aktionsfeld", 0xffffff],[625, 435, "Werderstraße", 0x3a3b97, 7000, 700],[625, 490, "Steuer", 0xffffff, -2000],[625, 545, "Werderplatz", 0x3a3b97, 8000, 1000]]
    ;1-D= X_POs, 2-D = y_POS, 3-D= Name, 4-D = Farbe, 5-D= Preis, 6-D= Wohnpreis OHNE HAUS,
    Global $aktuelles_feld = 0
    Global $gegner_feld = 0

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

    GUICreate("MONOPOLY", 1010, 700)
    GUISetBkColor(0x5050ff)
    $pos_label = GUICtrlCreateLabel("Position: " & $felder[0][2], 700, 0, 150, 12)
    GUICtrlSetFont(-1, 8)
    GUICtrlSetBkColor(-1, 0xff0000)
    $Gegner_pos_label = GUICtrlCreateLabel("Position: " & $felder[0][2], 860, 0, 150, 12)
    GUICtrlSetFont(-1, 8)
    GUICtrlSetBkColor(-1, 0xff0000)

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

    $Gegner_Geld_label = GUICtrlCreateLabel("Gegnergeld: " & $gegner_geld & ",-", 860, 12, 150, 18)
    GUICtrlSetFont(-1, 12)

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

    $Geld_label = GUICtrlCreateLabel("Geld: " & $geld & ",-", 700, 12, 150, 18)
    GUICtrlSetFont(-1, 12)

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

    $gekauft_btn = GUICtrlCreateLabel("GEKAUFT: " & @CRLF & $gekauft, 700, 50, 150, 500)
    GUICtrlSetBkColor(-1, 0xff00ff)

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

    $Gegner_gekauft_btn = GUICtrlCreateLabel("Gegner GEKAUFT: " & @CRLF & $Gegner_gekauft, 860, 50, 150, 500)
    GUICtrlSetBkColor(-1, 0xff00ff)

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

    $pic1 = GUICtrlCreatePic(@DesktopDir & "\Bilder\feld.jpg", 0, 0, 700, 700)
    $pic2 = GUICtrlCreatePic(@DesktopDir & "\Bilder\stein.jpg", $felder[0][0], $felder[0][1], 45, 45)
    $pic3 = GUICtrlCreatePic(@DesktopDir & "\Bilder\Gegner_stein.jpg", $felder[0][0] + 20, $felder[0][1] + 10, 45, 45)
    $wurflen_btn = GUICtrlCreateButton("WÜRFELN", 700, 600, 150, 100)
    GUISetState()
    ;~ For $i = 0 to 22
    ;~ GUICtrlSetPos ($pic2, $felder[$i][0], $felder[$i][1])
    ;~ Sleep (500)
    ;~ Next

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

    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $wurflen_btn
    Wurfeln()
    EndSelect

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

    WEnd

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

    Func wurfeln()
    $wurf1 = Random(1, 6, 1)
    $wurf2 = Random(1, 6, 1)
    $wurf = $wurf1 + $wurf2
    MsgBox(0, "Gewürfelt", "Du hast eine " & $wurf1 & " und eine " & $wurf2 & " gewürfelt!")
    $aktuelles_feld += $wurf
    If $aktuelles_feld >= 40 Then
    $aktuelles_feld -= 40
    $geld += 2000
    GUICtrlSetData($Geld_label, "Geld: " & $geld & ",-")
    EndIf

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

    GUICtrlSetPos($pic2, $felder[$aktuelles_feld][0], $felder[$aktuelles_feld][1])
    GUICtrlSetData($pos_label, "Position: " & $felder[$aktuelles_feld][2])
    GUICtrlSetBkColor($pos_label, $felder[$aktuelles_feld][3])
    If $felder[$aktuelles_feld][4] <= -1 Then
    $geld += $felder[$aktuelles_feld][4]
    GUICtrlSetData($Geld_label, "Geld: " & $geld & ",-")
    MsgBox(0, "SPENDE", "Du spendest " & $felder[$aktuelles_feld][4] - $felder[$aktuelles_feld][4] - $felder[$aktuelles_feld][4] & ",-!")
    EndIf

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

    If $felder[$aktuelles_feld][4] = "Gegner" Then
    MsgBox(0, "Bezahlen", "Sie müssen " & $felder[$aktuelles_feld][5] & ",- bezahlen, weil sie in "& $felder[$aktuelles_feld][2]&" übernachten!")
    $geld -= $felder[$aktuelles_feld][5]
    GUICtrlSetData($Geld_label, "Geld: " & $geld & ",-")
    EndIf

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

    If $felder[$aktuelles_feld][4] >= 1 Then
    $box = MsgBox(4, "Kaufen?", "Wollen sie " & $felder[$aktuelles_feld][2] & " für " & $felder[$aktuelles_feld][4] & ",- kaufen?")
    If $box = 6 Then
    $geld -= $felder[$aktuelles_feld][4]
    GUICtrlSetData($Geld_label, "Geld: " & $geld & ",-")
    $gekauft &= $felder[$aktuelles_feld][2] & @CRLF
    GUICtrlSetData($gekauft_btn, "GEKAUFT: " & @CRLF & $gekauft)
    $felder[$aktuelles_feld][4] = "von mir gekauft"
    EndIf
    If $geld <= 0 Then
    MsgBox(0, "VERLOREN", "Das Spiel ist vorbei, sie sind pleite!")
    Exit
    EndIf

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

    If $box = 7 Then

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

    EndIf
    EndIf

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

    Sleep(700)
    $comp2= Random(1, 6, 1)
    $comp=Random(1, 6, 1)
    $comp_random = $comp +$comp2
    $gegner_feld += $comp_random
    MsgBox (0,"Gegner Wurf", "Ihr Gegner hat eine "& $comp & " und eine "&$comp2& " gewürfelt!")
    If $gegner_feld >= 40 Then
    $gegner_feld -= 40
    $gegner_geld += 2000
    GUICtrlSetData($Gegner_Geld_label, "Gegnergeld: " & $gegner_geld & ",-")
    EndIf

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

    GUICtrlSetPos($pic3, $felder[$gegner_feld][0], $felder[$gegner_feld][1])
    GUICtrlSetData($Gegner_pos_label, "Position: " & $felder[$gegner_feld][2])
    GUICtrlSetBkColor($Gegner_pos_label, $felder[$gegner_feld][3])

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

    If $felder[$gegner_feld][4] <= -1 Then
    $gegner_geld += $felder[$gegner_feld][4]
    GUICtrlSetData($Gegner_Geld_label, "Gegnergeld: " & $gegner_geld & ",-")
    MsgBox(0, "SPENDE", "Ihr Gegner spendet " & $felder[$gegner_feld][4] - $felder[$gegner_feld][4] - $felder[$gegner_feld][4] & ",- !")
    EndIf

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

    If $felder[$gegner_feld][4] <= $gegner_geld + 1 Then
    If $felder[$gegner_feld][4] >= 1 Then
    $kaufen_ran = Random(1, 6, 1)
    If $kaufen_ran = 3 Or $kaufen_ran = 4 Or $kaufen_ran = 5 Or $kaufen_ran = 6 Or $kaufen_ran = 1 Then
    $Gegner_gekauft &= $felder[$gegner_feld][2] & @CRLF
    GUICtrlSetData($Gegner_gekauft_btn, "Gegner GEKAUFT: " & @CRLF & $Gegner_gekauft)
    MsgBox (0,"Gegnerkauf", "Ihr Gegner kauft "& $felder[$gegner_feld][2] & " für " & $felder[$gegner_feld][4] & ",- !")
    $gegner_geld -= $felder[$gegner_feld][4]
    $felder[$gegner_feld][4] = "Gegner"
    GUICtrlSetData($Gegner_Geld_label, "Gegnergeld: " & $gegner_geld & ",-")
    EndIf
    EndIf
    EndIf

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

    If $felder[$gegner_feld][4] = "von mir gekauft" Then
    $gegner_geld -= $felder[$gegner_feld][5]
    GUICtrlSetData($Gegner_Geld_label, "Gegnergeld: " & $gegner_geld & ",-")
    $geld += $felder[$gegner_feld][5]
    GUICtrlSetData($Geld_label, "Geld: " & $geld & ",-")
    MsgBox(0, "Einkommen", "Sie bekommen " & $felder[$gegner_feld][5] & ",- für eine Übernachtung in " &$felder[$gegner_feld][2] &"!")
    EndIf

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

    If $gegner_geld <= 0 Then
    MsgBox(0, "Gewonnen", "Ihr Gegner ist pleite! Sie haben gewonnen!")
    Exit
    EndIf
    EndFunc ;==>wurfeln

    [/autoit]


    Den Pfad bitte anpassen!

    Die Datei als .rar + Bilder:

    Dateien

    Monopoly.zip 125,85 kB – 542 Downloads
  • Kleines Spiel. Brauche Hilfe

    • BadBunny
    • 11. Dezember 2010 um 15:34

    Mir ist gerade eingefallen das du noch mehr an die 2-D Array hängen musst, den Preis, Die Anzahl der Häuser und sowas.

  • Kleines Spiel. Brauche Hilfe

    • BadBunny
    • 11. Dezember 2010 um 08:37

    Ich hab leider auch keine Bilder, aber wie wäre es wenn du jedem Feld eine Zahl zuweist, 1,2,3,4,5... und die Felder dann so nennst in 2-d Variablen mit den Koordinaten wo die Figur dann drauf soll? Und wenn du über Los gehst wird dein Postition wieder auf 0 bzw 1 (wie du willst) gesetz.
    EDIT://Wenn du die Bilder so drüber malst, kannst du auch mit ControlgetPos die X und Y Koord. bekommen und die in einer For -Schelife in eine Array Speichern.

  • Drehung eines Würfels berechnen

    • BadBunny
    • 10. Dezember 2010 um 22:13

    ACHTUNG! DIESER CODE IST NICHT von mir! Hier kannst du mal gucken wie UEZ das gemacht hat mit dem Würfel drehen.

    Spoiler anzeigen
    [autoit]

    ;coded by UEZ 2010
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    #AutoIt3Wrapper_Run_After=del /f /q "Rotating Cube 3_Obfuscated.au3"
    ;~ #AutoIt3Wrapper_Run_After=upx.exe --best "%out%"
    #AutoIt3Wrapper_Run_After=upx.exe --ultra-brute "%out%"
    #include <Array.au3>
    #include <GDIPlus.au3>
    #Include <Memory.au3>
    #include <String.au3>

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

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

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

    Local Const $Width = 800
    Local Const $Height = 600

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

    Local $hwnd = GUICreate("Rotating Cube 2 v0.60 Beta Build 2010-03-15 by UEZ 2010 (use mouse wheel to zoom)", $Width, $Height)

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

    GUISetState()

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

    If @OSBuild < 7600 Then WinSetTrans($hwnd,"", 0xFF) ;workaround for XP machines when alpha blending is activated on _GDIPlus_GraphicsClear() function to avoid slow drawing

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

    _GDIPlus_Startup()
    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
    Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics($Width, $Height, $hGraphics)
    Local $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsClear($hBackbuffer)
    _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)
    Local $hPen = _GDIPlus_PenCreate(0xF0000000, 2)

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

    Local $b, $j, $x, $y, $z, $mx, $my, $size, $start_x, $start_y, $mouse_pos, $mouse_sense
    Local Const $Pi = ACos(-1)
    Local Const $Pi_Div_180 = $Pi / 180
    Local $amout_of_dots = 15
    Local $dot_distance = 150
    Local $calc_coordinates[$amout_of_dots][3] = [ _; X y Z
    [-$dot_distance, -$dot_distance, $dot_distance], _
    [$dot_distance, -$dot_distance, $dot_distance], _
    [$dot_distance, $dot_distance, $dot_distance], _
    [-$dot_distance, $dot_distance, $dot_distance], _
    [-$dot_distance, -$dot_distance, -$dot_distance], _
    [$dot_distance, -$dot_distance, -$dot_distance], _
    [$dot_distance, $dot_distance, -$dot_distance], _
    [-$dot_distance, $dot_distance, -$dot_distance], _
    [-$dot_distance, -$dot_distance, $dot_distance]]
    ;surface 1 mid point
    $calc_coordinates[9][0] = 0
    $calc_coordinates[9][1] = 0
    $calc_coordinates[9][2] = $dot_distance
    ;surface 2 mid point
    $calc_coordinates[10][0] = 0
    $calc_coordinates[10][1] = -$dot_distance
    $calc_coordinates[10][2] = 0
    ;surface 3 mid point
    $calc_coordinates[11][0] = $dot_distance
    $calc_coordinates[11][1] = 0
    $calc_coordinates[11][2] = 0
    ;surface 4 mid point
    $calc_coordinates[12][0] = 0
    $calc_coordinates[12][1] = $dot_distance
    $calc_coordinates[12][2] = 0
    ;surface 5 mid point
    $calc_coordinates[13][0] = -$dot_distance
    $calc_coordinates[13][1] = 0
    $calc_coordinates[13][2] = 0
    ;surface 6 mid point
    $calc_coordinates[14][0] = 0
    $calc_coordinates[14][1] = 0
    $calc_coordinates[14][2] = -$dot_distance

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

    Local $zoom_counter = 100
    Local $zoom_min = 50
    Local $zoom_max = 150
    $mouse_sense = 100
    $start_x = $Width / 2
    $start_y = $Height / 2
    $j = 0

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

    #region Demo1
    Local Const $max_dots = 30
    Local Const $max_speed = 6
    Local Const $iWidth = 10
    Local Const $iHeight = 10
    Local Const $width_D1 = 300
    Local Const $height_D1 = 300
    Local $hBrush_Clear_D1 = _GDIPlus_BrushCreateSolid(0xFFF0FFE0)
    Local $hImage_D1 = _GDIPlus_BitmapCreateFromGraphics($width_D1, $height_D1, $hGraphics)
    Local $hImage_BB_D1 = _GDIPlus_ImageGetGraphicsContext($hImage_D1)
    _GDIPlus_GraphicsSetSmoothingMode($hImage_BB_D1, 2)
    Dim $coordinates[$max_dots][5], $angle_D1
    Dim $hBrush[$max_dots]
    Initialize()
    #endregion

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

    #region Demo2
    Local Const $width_D2 = 300
    Local Const $height_D2 = $width_D2
    Local $hImage_D2 = _GDIPlus_BitmapCreateFromGraphics($width_D2, $height_D2, $hGraphics)
    Local $hImage_BB_D2 = _GDIPlus_ImageGetGraphicsContext($hImage_D2)
    _GDIPlus_GraphicsSetSmoothingMode($hImage_BB_D2, 2)
    Local $xcoord1_D2, $ycoord1_D2, $xcoord2_D2, $ycoord2_D2, $size_D2, $red_D2, $green_D2, $blue_D2
    Local $i_D2 = -500
    Local $l = $i_D2
    Local $starting_point_D2 = 0
    Local $min_size_D2 = 10
    Local $Brush1_D2 = _GDIPlus_BrushCreateSolid(0)
    Local $Brush2_D2 = _GDIPlus_BrushCreateSolid(0)
    #endregion

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

    #region Demo3
    Local Const $width_D3 = 300
    Local Const $height_D3 = $width_D3
    Local $hImage_D3 = _GDIPlus_BitmapCreateFromGraphics($width_D3, $height_D3, $hGraphics)
    Local $hImage_BB_D3 = _GDIPlus_ImageGetGraphicsContext($hImage_D3)
    _GDIPlus_GraphicsSetSmoothingMode($hImage_BB_D3, 2)
    Local $Pen_D3 = _GDIPlus_PenCreate(0, 1)
    Local $red_D3, $green_D3, $blue_D3
    Local $start_D3 = -25
    Local $i_D3 = $start_D3
    Local $starting_point_D3 = 0
    #endregion

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

    #region Demo4
    Local Const $width_D4 = 300
    Local Const $height_D4 = $width_D3
    Local $hImage_D4 = _GDIPlus_BitmapCreateFromGraphics($width_D4, $height_D4, $hGraphics)
    Local $hImage_BB_D4 = _GDIPlus_ImageGetGraphicsContext($hImage_D4)
    _GDIPlus_GraphicsSetSmoothingMode($hImage_BB_D4, 2)
    Local $fontsize_txt1_D4 = 32
    Local $fontsize_txt2_D4 = 12
    Local $i_D4 = 0, $j_D4 = 360, $m_D4 = 0, $n_D4 = 0
    Local $width_mul_045_D4 = $width_D4 * 0.45
    Local $height_mul_045_D4 = $height_D4 * 0.45
    Local $radius_x1_D4 = ($width_mul_045_D4) * 0.95
    Local $radius_y1_D4 = ($height_mul_045_D4) * 0.95
    Local $radius_x2_D4 = ($width_mul_045_D4) * 0.45
    Local $radius_y2_D4 = ($height_mul_045_D4) * 0.45
    Local $text1_D4 = _StringReverse(" Rotating Letters using GDI+")
    Local $text2_D4 = " By UEZ '09 ;-)"
    Local $arrTxt1_D4 = StringSplit($text1_D4, "")
    Local $arrTxt2_D4 = StringSplit($text2_D4, "")
    Dim $arrX1_D4[UBound($arrTxt1_D4)]
    Dim $arrY1_D4[UBound($arrTxt1_D4)]
    Dim $arrX2_D4[UBound($arrTxt2_D4)]
    Dim $arrY2_D4[UBound($arrTxt2_D4)]
    Dim $brush1_D4[UBound($arrTxt1_D4)]
    Dim $brush2_D4[UBound($arrTxt2_D4)]

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

    Local $r_D4 = 1
    Local $c_D4 = (255 / UBound($arrTxt1_D4) - 1) * 2 - 1
    Local $r_D4 = 0x80
    Local $g_D4 = 0xA0
    Local $b_D4 = $c_D4
    Local $brush_color_D4
    For $k = 0 To UBound($arrTxt1_D4) - 1
    $brush_color_D4 = "0xFF" & Hex($r_D4, 2) & Hex($g_D4, 2) & Hex($b_D4, 2)
    $brush1_D4[$k] = _GDIPlus_BrushCreateSolid($brush_color_D4)
    If $r_D4 = 1 Then
    $b_D4 += $c_D4
    Else
    $b_D4 -= $c_D4
    EndIf
    If $b_D4 >= 255 Then $r_D4 = 0
    If $b_D4 <= $c_D4 Then $r_D4 = 1
    Next

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

    For $k = 0 To (UBound($arrTxt2_D4) - 1)
    $brush_color_D4 = 0xFF808080
    $brush2_D4[$k] = _GDIPlus_BrushCreateSolid($brush_color_D4)
    Next
    _GDIPlus_BrushSetSolidColor($brush2_D4[0], 0xFFD08020)
    _GDIPlus_BrushSetSolidColor($brush2_D4[1], 0xFFFFA060)
    _GDIPlus_BrushSetSolidColor($brush2_D4[2], 0xFFD08020)

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

    Local $hFormat_D4 = _GDIPlus_StringFormatCreate()
    Local $hFamily1_D4 = _GDIPlus_FontFamilyCreate("Arial")
    Local $hFamily2_D4 = _GDIPlus_FontFamilyCreate("Comic Sans MS")
    Local $hFont1_D4 = _GDIPlus_FontCreate($hFamily1_D4, $fontsize_txt1_D4, 2)
    Local $hFont2_D4 = _GDIPlus_FontCreate($hFamily2_D4, $fontsize_txt2_D4, 2)
    Local $tLayout_D4 = _GDIPlus_RectFCreate(0, 0)
    Local $a_D4 = 360 / (UBound($arrTxt1_D4) - 1)
    Local $b_D4 = 360 / (UBound($arrTxt2_D4) - 1)
    Local $y_D4 = 0
    #endregion

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

    #region Demo5
    Local Const $width_D5 = 300
    Local Const $height_D5 = $width_D5
    Local $hImage_D5 = _GDIPlus_BitmapCreateFromGraphics($width_D5, $height_D5, $hGraphics)
    Local $hImage_BB_D5 = _GDIPlus_ImageGetGraphicsContext($hImage_D5)
    _GDIPlus_GraphicsSetSmoothingMode($hImage_BB_D5, 2)
    _GDIPlus_GraphicsClear($hImage_BB_D5, 0xFF000000)
    Local Const $pi_Div_60 = $Pi / 60
    Local Const $pi_Mul_4 = $Pi * 4
    Local $Pen_D5, $Brush_D5, $ellipse_size_D5, $ellipse_size_double_D5
    Local $i_D5, $k_D5 = 0, $xcoord_D5, $ycoord_D5, $red_D5, $green_D5, $blue_D5
    Local $x1_D5, $x2_D5, $x3_D5, $x4_D5, $y1_D5, $y2_D5, $y3_D5, $y4_D5
    $Pen_D5 = _GDIPlus_PenCreate(0, 2)
    $Brush_D5 = _GDIPlus_BrushCreateSolid(0xFF000000)
    $ellipse_size_D5 = 1.025
    $ellipse_size_double_D5 = $ellipse_size_D5 * 2
    $i_D5 = 1
    #endregion

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

    #region Demo6
    Local Const $width_D6 = 300
    Local Const $height_D6 = $width_D6
    Local Const $font_size_D6 = Int(($width_D6 + $height_D6) / 16)
    Local $tLayout_D6
    Local Const $height_div_2_D6 = $height_D6 * 0.5
    Local Const $width_div_2_D6 = $width_D6 * 0.5
    Local $hImage_D6 = _GDIPlus_BitmapCreateFromGraphics($width_D6, $height_D6, $hGraphics)
    Local $hImage_BB_D6 = _GDIPlus_ImageGetGraphicsContext($hImage_D6)
    _GDIPlus_GraphicsSetSmoothingMode($hImage_BB_D6, 2)
    Local $hFormat_D6 = _GDIPlus_StringFormatCreate()
    Local $hFamily_D6 = _GDIPlus_FontFamilyCreate("Arial")
    Local $hFont_D6 = _GDIPlus_FontCreate($hFamily_D6, $font_size_D6, 2)
    Local $pen_D6 = _GDIPlus_PenCreate(0)
    Local $brush_D6 = _GDIPlus_BrushCreateSolid(0)
    Local $text_color_D6 = 0xA0F0F0FF
    $brush_D6 = _GDIPlus_HatchBrushCreate(39, $text_color_D6)
    Local $letter_distance_D6 = $font_size_D6
    Local $lenght_D6 = $font_size_D6 * 1.666 * 0.36
    Local $k_D6 = $width_D6
    Local $end_D6 = 0
    Local $text_scroller_D6 = "Welcome to GDI+ rotating cube with my GDI+ examples on each surface! You can use your mouse wheel to zoom cube ;) Have fun! "
    Local $scroller_length_D6 = StringLen($text_scroller_D6) * $lenght_D6
    Local $y_D6 = -($font_size_D6 * 0.2) + ($height_div_2_D6 - $font_size_D6 * 0.5)
    $tLayout_D6 = _GDIPlus_RectFCreate(0, 0)
    #endregion

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

    MouseMove(@DesktopWidth * 0.5, @DesktopHeight * 0.5, 0)

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

    GUISetOnEvent(-3, "Close")

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

    GUIRegisterMsg(0x020A, "WM_MOUSEWHEEL")

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

    Do
    _GDIPlus_GraphicsClear($hBackbuffer, 0xFF506070)
    $mouse_pos = MouseGetPos()
    For $j = 0 To $amout_of_dots - 1
    Calc(-(-@DesktopHeight * 0.5 + $mouse_pos[1]) / $mouse_sense, (-@DesktopWidth * 0.5 + $mouse_pos[0]) / $mouse_sense, $j) ;calculate new coordinates
    Next
    Draw_Lines() ;draw lines to screen
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $Width, $Height)
    Until Not Sleep(10)

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

    Func Draw_Lines()
    Local $p, $q
    For $p = 9 To 14
    Switch $p
    Case 9 ;fill surface 1 -> front
    If $calc_coordinates[$p][2] > 0 Then
    Demo6()
    _GDIPlus_DrawImagePoints($hBackbuffer, $hImage_D6, $start_x + $calc_coordinates[0][0], $start_y + $calc_coordinates[0][1], _
    $start_x + $calc_coordinates[1][0], $start_y + $calc_coordinates[1][1], _
    $start_x + $calc_coordinates[3][0], $start_y + $calc_coordinates[3][1])
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[0][0], $start_y + $calc_coordinates[0][1], _
    ;~ $start_x + $calc_coordinates[1][0], $start_y + $calc_coordinates[1][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[1][0], $start_y + $calc_coordinates[1][1], _
    ;~ $start_x + $calc_coordinates[2][0], $start_y + $calc_coordinates[2][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[2][0], $start_y + $calc_coordinates[2][1], _
    ;~ $start_x + $calc_coordinates[3][0], $start_y + $calc_coordinates[3][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[3][0], $start_y + $calc_coordinates[3][1], _
    ;~ $start_x + $calc_coordinates[0][0], $start_y + $calc_coordinates[0][1], $hPen)
    EndIf

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

    Case 10 ;fill surface 2 -> top
    If $calc_coordinates[$p][2] > 0 Then
    Demo2()
    _GDIPlus_DrawImagePoints($hBackbuffer, $hImage_D2, $start_x + $calc_coordinates[4][0], $start_y + $calc_coordinates[4][1], _
    $start_x + $calc_coordinates[5][0], $start_y + $calc_coordinates[5][1], _
    $start_x + $calc_coordinates[0][0], $start_y + $calc_coordinates[0][1])
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[0][0], $start_y + $calc_coordinates[0][1], _
    ;~ $start_x + $calc_coordinates[4][0], $start_y + $calc_coordinates[4][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[4][0], $start_y + $calc_coordinates[4][1], _
    ;~ $start_x + $calc_coordinates[5][0], $start_y + $calc_coordinates[5][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[5][0], $start_y + $calc_coordinates[5][1], _
    ;~ $start_x + $calc_coordinates[1][0], $start_y + $calc_coordinates[1][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[1][0], $start_y + $calc_coordinates[1][1], _
    ;~ $start_x + $calc_coordinates[0][0], $start_y + $calc_coordinates[0][1], $hPen)
    EndIf
    Case 11 ;fill surface 3 -> right
    If $calc_coordinates[$p][2] > 0 Then
    Demo3()
    _GDIPlus_DrawImagePoints($hBackbuffer, $hImage_D3, $start_x + $calc_coordinates[5][0], $start_y + $calc_coordinates[5][1], _
    $start_x + $calc_coordinates[1][0], $start_y + $calc_coordinates[1][1], _
    $start_x + $calc_coordinates[6][0], $start_y + $calc_coordinates[6][1])
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[1][0], $start_y + $calc_coordinates[1][1], _
    ;~ $start_x + $calc_coordinates[5][0], $start_y + $calc_coordinates[5][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[5][0], $start_y + $calc_coordinates[5][1], _
    ;~ $start_x + $calc_coordinates[6][0], $start_y + $calc_coordinates[6][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[6][0], $start_y + $calc_coordinates[6][1], _
    ;~ $start_x + $calc_coordinates[2][0], $start_y + $calc_coordinates[2][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[2][0], $start_y + $calc_coordinates[2][1], _
    ;~ $start_x + $calc_coordinates[1][0], $start_y + $calc_coordinates[1][1], $hPen)
    EndIf
    Case 12 ;fill surface 4 -> bottom
    If $calc_coordinates[$p][2] > 0 Then
    Demo4()
    _GDIPlus_DrawImagePoints($hBackbuffer, $hImage_D4, $start_x + $calc_coordinates[3][0], $start_y + $calc_coordinates[3][1], _
    $start_x + $calc_coordinates[2][0], $start_y + $calc_coordinates[2][1], _
    $start_x + $calc_coordinates[7][0], $start_y + $calc_coordinates[7][1])
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[2][0], $start_y + $calc_coordinates[2][1], _
    ;~ $start_x + $calc_coordinates[3][0], $start_y + $calc_coordinates[3][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[3][0], $start_y + $calc_coordinates[3][1], _
    ;~ $start_x + $calc_coordinates[7][0], $start_y + $calc_coordinates[7][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[7][0], $start_y + $calc_coordinates[7][1], _
    ;~ $start_x + $calc_coordinates[6][0], $start_y + $calc_coordinates[6][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[6][0], $start_y + $calc_coordinates[6][1], _
    ;~ $start_x + $calc_coordinates[2][0], $start_y + $calc_coordinates[2][1], $hPen)
    EndIf
    Case 13 ;fill surface 5 -> left
    If $calc_coordinates[$p][2] > 0 Then
    Demo5()
    _GDIPlus_DrawImagePoints($hBackbuffer, $hImage_D5, $start_x + $calc_coordinates[4][0], $start_y + $calc_coordinates[4][1], _
    $start_x + $calc_coordinates[0][0], $start_y + $calc_coordinates[0][1], _
    $start_x + $calc_coordinates[7][0], $start_y + $calc_coordinates[7][1])
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[0][0], $start_y + $calc_coordinates[0][1], _
    ;~ $start_x + $calc_coordinates[4][0], $start_y + $calc_coordinates[4][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[4][0], $start_y + $calc_coordinates[4][1], _
    ;~ $start_x + $calc_coordinates[7][0], $start_y + $calc_coordinates[7][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[7][0], $start_y + $calc_coordinates[7][1], _
    ;~ $start_x + $calc_coordinates[3][0], $start_y + $calc_coordinates[3][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[3][0], $start_y + $calc_coordinates[3][1], _
    ;~ $start_x + $calc_coordinates[0][0], $start_y + $calc_coordinates[0][1], $hPen)
    EndIf

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

    Case 14 ;fill surface 6 -> back
    If $calc_coordinates[$p][2] > 0 Then
    Demo1()
    _GDIPlus_DrawImagePoints($hBackbuffer, $hImage_D1, $start_x + $calc_coordinates[5][0], $start_y + $calc_coordinates[5][1], _
    $start_x + $calc_coordinates[4][0], $start_y + $calc_coordinates[4][1], _
    $start_x + $calc_coordinates[6][0], $start_y + $calc_coordinates[6][1])
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[4][0], $start_y + $calc_coordinates[4][1], _
    ;~ $start_x + $calc_coordinates[5][0], $start_y + $calc_coordinates[5][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[5][0], $start_y + $calc_coordinates[5][1], _
    ;~ $start_x + $calc_coordinates[6][0], $start_y + $calc_coordinates[6][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[6][0], $start_y + $calc_coordinates[6][1], _
    ;~ $start_x + $calc_coordinates[7][0], $start_y + $calc_coordinates[7][1], $hPen)
    ;~ _GDIPlus_GraphicsDrawLine($hBackbuffer, $start_x + $calc_coordinates[7][0], $start_y + $calc_coordinates[7][1], _
    ;~ $start_x + $calc_coordinates[4][0], $start_y + $calc_coordinates[4][1], $hPen)
    EndIf
    EndSwitch
    Next
    EndFunc ;==>Draw

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

    Func Calc($angle_x, $angle_y, $i)
    ;calculate 3D rotation
    $x = ($calc_coordinates[$i][0] * Cos($angle_y * $Pi_Div_180)) + ($calc_coordinates[$i][2] * Sin($angle_y * $Pi_Div_180))
    $y = $calc_coordinates[$i][1]
    $z = (-$calc_coordinates[$i][0] * Sin($angle_y * $Pi_Div_180)) + ($calc_coordinates[$i][2] * Cos($angle_y * $Pi_Div_180))
    $calc_coordinates[$i][0] = $x
    $calc_coordinates[$i][1] = ($y * Cos($angle_x * $Pi_Div_180)) - ($z * Sin($angle_x * $Pi_Div_180))
    $calc_coordinates[$i][2] = ($y * Sin($angle_x * $Pi_Div_180)) + ($z * Cos($angle_x * $Pi_Div_180))
    EndFunc ;==>Calc

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

    Func Close()
    Close_Demo1()
    Close_Demo2()
    Close_Demo3()
    Close_Demo4()
    Close_Demo5()
    Close_Demo6()
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>Close

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

    Func Zoom($factor)
    Local $m
    For $m = 0 To $amout_of_dots - 1
    $calc_coordinates[$m][0] *= $factor
    $calc_coordinates[$m][1] *= $factor
    $calc_coordinates[$m][2] *= $factor
    Next
    EndFunc

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

    Func WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam)
    Local $wheel_Dir = BitAND($wParam, 0x800000)
    If $wheel_Dir > 0 Then
    If $zoom_counter <= $zoom_max Then
    Zoom(1.05)
    $zoom_counter += 1
    EndIf
    Else
    If $zoom_counter >= $zoom_min Then
    Zoom(0.95)
    $zoom_counter -= 1
    EndIf
    EndIf
    Return "GUI_RUNDEFMSG"
    EndFunc ;==>WM_MOUSEWHEEL

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

    #region Demo1
    Func Demo1()
    Draw_Dots()
    Calculate_New_Position()
    EndFunc

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

    Func Initialize()
    Local $k
    For $k = 0 To $max_dots - 1
    $hBrush[$k] = _GDIPlus_BrushCreateSolid(Random(0xA0101010, 0xA0808080, 1))
    New_Coordinates($k)
    Next
    EndFunc ;==>Initialize

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

    Func Draw_Dots()
    Local $i
    _GDIPlus_GraphicsFillRect($hImage_BB_D1, 0, 0, $width_D1, $height_D1, $hBrush_Clear_D1)
    For $i = 0 To $max_dots - 1
    _GDIPlus_GraphicsFillEllipse($hImage_BB_D1, $coordinates[$i][0], $coordinates[$i][1], $iWidth, $iHeight, $hBrush[$i])
    Next
    EndFunc ;==>Draw_Dots

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

    Func New_Coordinates($k)
    $coordinates[$k][0] = $width_D1 / 2
    $coordinates[$k][1] = $height_D1 / 2
    $coordinates[$k][2] = Random(1, $max_speed, 1)
    $angle_D1 = Random(0, 359, 0)
    $coordinates[$k][3] = $coordinates[$k][2] * Cos($angle_D1 * $Pi_Div_180)
    $coordinates[$k][4] = $coordinates[$k][2] * Sin($angle_D1 * $Pi_Div_180)
    EndFunc ;==>New_Coordinates

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

    Func Calculate_New_Position()
    Local $k
    For $k = 0 To $max_dots - 1
    $coordinates[$k][0] += $coordinates[$k][3] ;increase x coordinate with appropriate slope
    $coordinates[$k][1] += $coordinates[$k][4] ;increase y coordinate with appropriate slope
    If $coordinates[$k][0] <= 0 Then ;border collision x left
    $coordinates[$k][0] = 1
    $coordinates[$k][3] *= -1
    ElseIf $coordinates[$k][0] >= $width_D1 - $iWidth Then ;border collision x right
    $coordinates[$k][0] = $width_D1 - ($iWidth + 1)
    $coordinates[$k][3] *= -1
    EndIf
    If $coordinates[$k][1] <= 0 Then ;border collision y top
    $coordinates[$k][1] = 1
    $coordinates[$k][4] *= -1
    ElseIf $coordinates[$k][1] >= $height_D1 - $iHeight Then ;border collision y bottom
    $coordinates[$k][1] = $height_D1 - ($iHeight + 1)
    $coordinates[$k][4] *= -1
    EndIf
    Next
    EndFunc ;==>Calculate_New_Position

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

    Func Close_Demo1()
    Local $k
    For $k = 0 To $max_dots - 1
    _GDIPlus_BrushDispose($hBrush[$k])
    Next
    _GDIPlus_BrushDispose($hBrush_Clear_D1)
    _GDIPlus_BitmapDispose($hImage_D1)
    _GDIPlus_GraphicsDispose($hImage_BB_D1)
    EndFunc
    #endregion

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

    #region Demo2
    Func Demo2()
    Local $k, $j, $x
    _GDIPlus_GraphicsClear($hImage_BB_D2, 0xFFFFFFFF) ;clear buffer
    $k = 1024 ;2^12
    $starting_point_D2 -= 0.05
    For $j = 0 To $k Step 64
    $red_D2 = ((Sin(2 * ($i_D2 + $j) / 1024) + 1) * 0.5) * 256
    $green_D2 = ((Sin(4 * ($i_D2 + $j) / 512) + 1) * 0.5) * 256
    $blue_D2 = ((Sin(8 * ($i_D2 + $j) / 256) + 1) * 0.5) * 256
    _GDIPlus_BrushSetSolidColor($Brush1_D2, "0xCF" & Hex($red_D2, 2) & Hex($green_D2, 2) & Hex($blue_D2, 2))
    _GDIPlus_BrushSetSolidColor($Brush2_D2, "0xCF" & Hex($blue_D2, 2) & Hex($red_D2, 2) & Hex($green_D2, 2))
    $size_D2 = $i_D2 - $j
    $xcoord1_D2 = $width_D2 * 0.5 - (($i_D2 - $j) / 2) + Sin($starting_point_D2) * -Sin(($i_D2 - $j) * $Pi / 90) * 64
    $ycoord1_D2 = $height_D2 * 0.5 - (($i_D2 - $j) / 2) + -Cos($starting_point_D2) * Cos(($i_D2 - $j) * $Pi / 90) * 32
    _GDIPlus_GraphicsFillEllipse($hImage_BB_D2, $xcoord1_D2, $ycoord1_D2, $size_D2 / 6, $size_D2 / 6, $Brush1_D2)
    $xcoord2_D2 = $width_D2 * 0.5 - (-($i_D2 - $j) / -1.75) - Sin($starting_point_D2) * Sin(($i_D2 - $j) * $Pi / 120) * 32
    $ycoord2_D2 = $height_D2 * 0.5 - (($i_D2 - $j) / -1.75) - Cos($starting_point_D2) * Cos(($i_D2 - $j) * $Pi / 75) * 16
    _GDIPlus_GraphicsFillEllipse($hImage_BB_D2, $xcoord2_D2, $ycoord2_D2, $size_D2 * 0.125 , $size_D2 * 0.125, $Brush2_D2)
    Next
    $i_D2 += 3
    If $i_D2 > $k + Abs($l) Then $i_D2 = $l
    EndFunc

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

    Func Close_Demo2()
    _GDIPlus_BrushDispose($Brush1_D2)
    _GDIPlus_BrushDispose($Brush2_D2)
    _GDIPlus_BitmapDispose($hImage_D2)
    _GDIPlus_GraphicsDispose($hImage_BB_D2)
    EndFunc
    #endregion

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

    #region Demo3
    Func Demo3()
    Local $k, $j, $size_D3, $xcoord_D3, $ycoord_D3
    _GDIPlus_GraphicsClear($hImage_BB_D3, 0xFF000000)
    $k = 256
    $starting_point_D3 -= 0.025
    For $j = $k To 0 Step -16
    $red_D3 = ((Sin(($j - $i_D3) / 32) + 1) * 0.5) * 256
    $green_D3 = ((Sin(($j - $i_D3) / 128) + 1) * 0.5) * 256
    $blue_D3 = ((Sin(($j - $i_D3) / 512) + 1) * 0.5) * 256
    _GDIPlus_PenSetColor($Pen_D3, "0xEF" & Hex($red_D3, 2) & Hex($green_D3, 2) & Hex($blue_D3, 2))
    $size_D3 = $i_D3 - $j
    $xcoord_D3 = $width_D3 * 0.5 - (($i_D3 - $j) * 0.5) + Sin($starting_point_D3) * -Sin(($i_D3 - $j) * $Pi_Div_180) * 64
    $ycoord_D3 = $height_D3 * 0.5 - (($i_D3 - $j) * 0.5) + -Cos($starting_point_D3) * Cos(($i_D3 - $j) * $Pi_Div_180) * 32
    _GDIPlus_GraphicsDrawRect($hImage_BB_D3, $xcoord_D3, $ycoord_D3, $size_D3, $size_D3, $Pen_D3)
    Next
    $i_D3 += 2
    If $i_D3 > $k + 512 Then $i_D3 = $start_D3
    EndFunc

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

    Func Close_Demo3()
    _GDIPlus_PenDispose($Pen_D3)
    _GDIPlus_BitmapDispose($hImage_D3)
    _GDIPlus_GraphicsDispose($hImage_BB_D3)
    EndFunc
    #endregion

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

    #region Demo4
    Func Demo4()
    Local $x, $x1, $x2, $y1, $y2
    _GDIPlus_GraphicsClear($hImage_BB_D4, 0xFF000000)
    For $x = 1 To UBound($arrTxt1_D4) - 1
    $x1 = $width_mul_045_D4 + Cos(($i_D4 + $m_D4) * $pi_div_180) * $radius_x1_D4
    $y1 = $height_mul_045_D4 + Sin(($i_D4 + $m_D4) * $pi_div_180) * $radius_y1_D4 - $fontsize_txt1_D4 * 0.25
    $arrX1_D4[$x] = $x1
    $arrY1_D4[$x] = $y1
    DllStructSetData($tLayout_D4, "x", $arrX1_D4[$x])
    DllStructSetData($tLayout_D4, "y", $arrY1_D4[$x])
    _GDIPlus_GraphicsDrawStringEx($hImage_BB_D4, $arrTxt1_D4[$x], $hFont1_D4, $tLayout_D4, $hFormat_D4, $brush1_D4[$x])
    $m_D4 += $a_D4
    Next
    For $x = 1 To UBound($arrTxt2_D4) - 1
    $x2 = $width_mul_045_D4 + Cos(($j_D4 + $n_D4) * $pi_div_180) * $radius_x2_D4 * Cos($y_D4 * $pi_div_180)
    $y2 = $height_mul_045_D4 + Sin(($j_D4 + $n_D4) * $pi_div_180) * $radius_y2_D4 - $fontsize_txt2_D4 * 0.25
    $arrX2_D4[$x] = $x2
    $arrY2_D4[$x] = $y2
    DllStructSetData($tLayout_D4, "x", $arrX2_D4[$x])
    DllStructSetData($tLayout_D4, "y", $arrY2_D4[$x])
    _GDIPlus_GraphicsDrawStringEx($hImage_BB_D4, $arrTxt2_D4[$x], $hFont2_D4, $tLayout_D4, $hFormat_D4, $brush2_D4[$x])
    $n_D4 += $b_D4
    Next
    If Mod($y_D4, 2) = 1 Then Array_Rot($brush2_D4, 1)
    $y_D4 += 1
    $i_D4 += 1
    If $i_D4 >= 360 Then
    $i_D4 = 0
    $m_D4 = 0
    EndIf
    $j_D4 -= 2
    If $j_D4 <= 0 Then
    $j_D4 = 360
    $n_D4 = 0
    EndIf
    EndFunc

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

    Func Array_Rot(ByRef $arr, $dir = 0) ;0 for left, 1 for right
    Local $tmp, $p,$q
    If $dir = 0 Then ;left rotation
    $tmp = $arr[0]
    $q = 0
    For $p = 1 To UBound($arr) - 1
    $arr[$q] = $arr[$p]
    $q += 1
    Next
    $arr[UBound($arr) - 1] = $tmp
    ElseIf $dir = 1 Then ;right rotation
    $tmp = $arr[UBound($arr) - 1]
    $q = UBound($arr) - 1
    For $p = UBound($arr) - 2 To 0 Step - 1
    $arr[$q] = $arr[$p]
    $q -= 1
    Next
    $arr[0] = $tmp
    EndIf
    EndFunc

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

    Func Close_Demo4()
    Local $x
    For $x = 0 To UBound($arrTxt1_D4) - 1
    _GDIPlus_BrushDispose($brush1_D4[$x])
    Next
    For $x = 0 To UBound($arrTxt2_D4) - 1
    _GDIPlus_BrushDispose($brush2_D4[$x])
    Next
    _GDIPlus_FontDispose($hFont1_D4)
    _GDIPlus_FontDispose($hFont2_D4)
    _GDIPlus_FontFamilyDispose($hFamily1_D4)
    _GDIPlus_FontFamilyDispose($hFamily2_D4)
    _GDIPlus_StringFormatDispose($hFormat_D4)
    _GDIPlus_GraphicsDispose($hImage_BB_D4)
    _GDIPlus_BitmapDispose($hImage_D4)
    EndFunc
    #endregion

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

    #region Demo5
    Func Demo5()
    Local $j
    _GDIPlus_GraphicsFillRect($hImage_BB_D5, $width_D5 * 0.5 - $ellipse_size_D5 * $k_D5, $height_D5 * 0.5 - $ellipse_size_D5 * $k_D5, _
    $ellipse_size_double_D5 * $k_D5, $ellipse_size_double_D5 * $k_D5, $Brush_D5) ;clear only area where the squares are drawn
    If $k_D5 <= 3 * $width_D5 / 7 Then $k_D5 += 1
    For $j = 8 To $k_D5 Step 24 + Cos($i_D5 * $pi_Div_60) * 12
    $red_D5 = ((Sin(($j - $i_D5) / 32) + 1) * 0.5) * 256
    $green_D5 = ((Sin(($j - $i_D5) / 128) + 1) * 0.5) * 256
    $blue_D5 = ((Sin(($j - $i_D5) / 512) + 1) * 0.5) * 256
    _GDIPlus_PenSetColor($Pen_D5, "0xEF" & Hex($red_D5, 2) & Hex($green_D5, 2) & Hex($blue_D5, 2)) ;Set the pen color
    $xcoord_D5 = $j ;+ Sin($i * $Pi / 60) * 8
    $ycoord_D5 = $j ;+ Cos($i * $Pi / 60) * 8
    Square($xcoord_D5, $ycoord_D5, $j * Sin($i_D5 / $k_D5 * $pi_Mul_4) * 0.66666667)
    Next
    $i_D5 += 1.5
    EndFunc

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

    Func Close_Demo5()
    _GDIPlus_BrushDispose($Brush_D5)
    _GDIPlus_PenDispose($Pen_D5)
    _GDIPlus_BitmapDispose($hImage_D5)
    _GDIPlus_GraphicsDispose($hImage_BB_D5)
    EndFunc

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

    Func Square($xx1, $yy1, $i) ;coded by UEZ
    Local $degree = 45
    $x1_D5 = $xx1 * Cos(($i + $degree + 0) * $pi_Div_180) + $width_D5 * 0.5
    $y1_D5 = $yy1 * Sin(($i + $degree + 0) * $pi_Div_180) + $height_D5 * 0.5
    $x2_D5 = $xx1 * Cos(($i + $degree + 90) * $pi_Div_180) + $width_D5 * 0.5
    $y2_D5 = $yy1 * Sin(($i + $degree + 90) * $pi_Div_180) + $height_D5 * 0.5
    $x3_D5 = $xx1 * Cos(($i + $degree + 180) * $pi_Div_180) + $width_D5 * 0.5
    $y3_D5 = $yy1 * Sin(($i + $degree + 180) * $pi_Div_180) + $height_D5 * 0.5
    $x4_D5 = $xx1 * Cos(($i + $degree + 270) * $pi_Div_180) + $width_D5 * 0.5
    $y4_D5 = $yy1 * Sin(($i + $degree + 270) * $pi_Div_180) + $height_D5 * 0.5
    _GDIPlus_GraphicsDrawLine($hImage_BB_D5, $x1_D5, $y1_D5, $x2_D5, $y2_D5, $Pen_D5)
    _GDIPlus_GraphicsDrawLine($hImage_BB_D5, $x2_D5, $y2_D5, $x3_D5, $y3_D5, $Pen_D5)
    _GDIPlus_GraphicsDrawLine($hImage_BB_D5, $x3_D5, $y3_D5, $x4_D5, $y4_D5, $Pen_D5)
    _GDIPlus_GraphicsDrawLine($hImage_BB_D5, $x4_D5, $y4_D5, $x1_D5, $y1_D5, $Pen_D5)
    EndFunc
    #endregion

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

    #region Demo6
    Func Demo6()
    Local $x
    _GDIPlus_GraphicsClear($hImage_BB_D6, 0xFF000000)
    $x = $k_D6 + $letter_distance_D6
    DllStructSetData($tLayout_D6, "x", $x)
    DllStructSetData($tLayout_D6, "y", $y_D6)
    _GDIPlus_GraphicsDrawStringEx($hImage_BB_D6, $text_scroller_D6, $hFont_D6, $tLayout_D6, $hFormat_D6, $brush_D6)
    $k_D6 -= 1
    If -$scroller_length_D6 >= $k_D6 Then
    $k_D6 = $width_D6
    EndIf
    EndFunc

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

    Func _GDIPlus_HatchBrushCreate($iHatchStyle = 0, $iARGBForeground = 0xFFFFFFFF, $iARGBBackground = 0xFFFFFFFF)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateHatchBrush", "int", $iHatchStyle, "uint", $iARGBForeground, "uint", $iARGBBackground, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return $aResult[4]
    EndFunc

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

    Func Close_Demo6()
    $tLayout_D6 = 0
    _GDIPlus_BrushDispose($brush_D6)
    _GDIPlus_FontDispose($hFont_D6)
    _GDIPlus_FontFamilyDispose($hFamily_D6)
    _GDIPlus_StringFormatDispose($hFormat_D6)
    _GDIPlus_BitmapDispose($hImage_D6)
    _GDIPlus_GraphicsDispose($hImage_BB_D6)
    EndFunc
    #endregion

    [/autoit]
  • SB Sprüche

    • BadBunny
    • 10. Dezember 2010 um 22:08

    Woa :O Da sieht man mal was alles in der SB steht :D
    Eine Menge Arbeit :D Sind echt ein paar Kracher dabei. Ich bin auch in einem vertreten :party:
    Wenn man bedengt das du die bestimmt noch kein Jahr "sammelst" würd ich gerne mal wissen was rauskommt wenn man das länger macht :D

  • such spiel

    • BadBunny
    • 10. Dezember 2010 um 19:12

    Ein wirklich gute Idee! Es ist noch etwas... einfach^^ aber das kann man ja ändern. Was mich stört ist, das es (anscheinend) imemr durch Zufall ausgewählt wird und dann öfters kommt. Vllt ein Durchgang und dann Schluss oder neues Level.
    Das bleibt dir überlassen :D

  • Hallo miteinander

    • BadBunny
    • 10. Dezember 2010 um 18:51

    Willkommen :party:
    Wie AutoBert schon sagte bekommt man hier schnell Hilfe und man lernt wirklich schnell!
    Viel Spaß! :party:

  • IniReadSection -> InideleteSection

    • BadBunny
    • 10. Dezember 2010 um 14:17
    [autoit]

    IniWriteSection ( "filename", "section", "" )

    [/autoit]


    Jetzt hast du eine leere Section.

  • GDI Plus Input & Button

    • BadBunny
    • 10. Dezember 2010 um 14:10

    Hier mal BSP für das anklicken (mit Koordinaten, ohne Label dahinter!)
    Ich hab das Script bei mir rumfliegen gehabt, kann sein das es von jemand anderem ist, also sag ich jetzt nicht es ist von mir:

    [autoit]

    #include <GuiConstants.au3>
    #include <GdiPlus.au3>;das include
    #include <Misc.au3>
    #include <WindowsConstants.au3>
    $GUI_Width = 200
    $GUI_Height = 200

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

    $Gui = GUICreate ("Dies ist ein Test GUI", 200, 200, 500, 200, $WS_POPUP)

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

    GUISetBkColor (0x149999, $Gui)
    _GDIPlus_Startup()

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

    GUISetState(@SW_SHOW)
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($Gui)
    $btn_exit = _GDIPlus_GraphicsFillEllipse($hGraphic,180,0,20,20) ;kreis
    ;~ _GDIPlus_ArrowCapCreate(20, 20) ;Pfeil
    _GDIPlus_GraphicsDrawString ($hGraphic, "Test zu Gdi+ koordinaten + klick", 20, 40, "Times", 8)

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

    While 1

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

    $mouse = GUIGetCursorInfo()
    If IsArray ($mouse) then
    If $mouse[2] = 1 Then
    If $mouse[0] > 180 And $mouse[1] < 20 Then
    Exit
    EndIf
    EndIf
    EndIf

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

    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch

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

    WEnd

    [/autoit]

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™