GDI+ Beispiel: Drehende Dreiecke + Drehende Quadrate

  • Die Überschrift sagt eigentlich schon alles. :)
    Danke an UEZ, der mich auf die Idee gebracht hat!

    Die Scripte sind auch ausreichend kommentiert, für die, die sich weniger auskennen.

    GDI+Beispiel: Drehende Dreiecke
    [autoit]

    #include <GDIPlus.au3>

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

    Opt("GUIOnEventMode", 1); Setzt das Script in den OnEventModus

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

    Global $hGraphic, $bitmap, $backbuffer, $Pen, $brush
    Global $rotation1 = 0, $rotation2 = 0, $rotation3 = 0, $rotation4 = 0, $rotation5 = 0
    Global $Pi = 3.14159

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

    $hwnd = GUICreate("GDI+ Beispiel: Drehende Dreiecke", 450, 450, -1, -1); Erstellt ein Fenster
    GUISetBkColor(0x000000); Setzt die Hintergrundfarbe der GUI auf schwarz
    GUISetOnEvent(-3, "_Close"); Die Funktion '_Close' wird ausgeführt, wenn das Fenster geschlossen wird
    GUISetState(@SW_SHOW, $hwnd); Macht das Fenster sichtbar

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

    _GDIPlus_Startup(); Ladet die GDI+ dll
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hwnd) ; Erstelle GDI+ Objekt von der GUI (Grafik)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics(450, 450, $hGraphic) ; Erstelle Bitmap von der Grafik
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap) ; Erstelle Grafik Kontext von der Bitmap (dient für die Doppeltbufferung der Grafik, damit die Bewegungen flüssiger aussehen
    $pen = _GDIPlus_PenCreate(0, 1) ; Erstelle Stift mit der Stärke 1 Pixels
    _GDIPlus_PenSetColor($Pen, 0xFF00FF00) ; Setze Stiftfarbe
    $brush = _GDIPlus_BrushCreateSolid(0x10000000); Erstellt ein vollfarbiges Pinselobjekt

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

    While 1
    _GDIPlus_GraphicsFillRect($backbuffer, 0, 0, 450, 450, $brush); Überzeichnet den Buffer mit einem transparentem schwarz
    ; Ab hier werden die Dreiecke im Buffer gezeichnet und berechnet
    $rotation1 += $Pi / 200
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation1 + $Pi / 2) * 200 + 450 / 2, Sin($rotation1 + $Pi / 2) * 200 + 450 / 2, Cos($rotation1 + $Pi / 2 + (2 * $Pi) / 3) * 200 + 450 / 2, Sin($rotation1 + $Pi / 2 + (2 * $Pi) / 3) * 200 + 450 / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation1 + $Pi / 2 + (2 * $Pi) / 3) * 200 + 450 / 2, Sin($rotation1 + $Pi / 2 + (2 * $Pi) / 3) * 200 + 450 / 2, Cos($rotation1 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 200 + 450 / 2, Sin($rotation1 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 200 + 450 / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation1 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 200 + 450 / 2, Sin($rotation1 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 200 + 450 / 2, Cos($rotation1 + $Pi / 2) * 200 + 450 / 2, Sin($rotation1 + $Pi / 2) * 200 + 450 / 2, $pen)
    $rotation2 -= $Pi / 100
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation2 + $Pi / 2) * 100 + 450 / 2, Sin($rotation2 + $Pi / 2) * 100 + 450 / 2, Cos($rotation2 + $Pi / 2 + (2 * $Pi) / 3) * 100 + 450 / 2, Sin($rotation2 + $Pi / 2 + (2 * $Pi) / 3) * 100 + 450 / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation2 + $Pi / 2 + (2 * $Pi) / 3) * 100 + 450 / 2, Sin($rotation2 + $Pi / 2 + (2 * $Pi) / 3) * 100 + 450 / 2, Cos($rotation2 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 100 + 450 / 2, Sin($rotation2 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 100 + 450 / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation2 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 100 + 450 / 2, Sin($rotation2 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 100 + 450 / 2, Cos($rotation2 + $Pi / 2) * 100 + 450 / 2, Sin($rotation2 + $Pi / 2) * 100 + 450 / 2, $pen)
    $rotation3 += $Pi / 50
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation3 + $Pi / 2) * 50 + 450 / 2, Sin($rotation3 + $Pi / 2) * 50 + 450 / 2, Cos($rotation3 + $Pi / 2 + (2 * $Pi) / 3) * 50 + 450 / 2, Sin($rotation3 + $Pi / 2 + (2 * $Pi) / 3) * 50 + 450 / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation3 + $Pi / 2 + (2 * $Pi) / 3) * 50 + 450 / 2, Sin($rotation3 + $Pi / 2 + (2 * $Pi) / 3) * 50 + 450 / 2, Cos($rotation3 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 50 + 450 / 2, Sin($rotation3 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 50 + 450 / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation3 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 50 + 450 / 2, Sin($rotation3 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 50 + 450 / 2, Cos($rotation3 + $Pi / 2) * 50 + 450 / 2, Sin($rotation3 + $Pi / 2) * 50 + 450 / 2, $pen)
    $rotation4 -= $Pi / 25
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation4 + $Pi / 2) * 25 + 450 / 2, Sin($rotation4 + $Pi / 2) * 25 + 450 / 2, Cos($rotation4 + $Pi / 2 + (2 * $Pi) / 3) * 25 + 450 / 2, Sin($rotation4 + $Pi / 2 + (2 * $Pi) / 3) * 25 + 450 / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation4 + $Pi / 2 + (2 * $Pi) / 3) * 25 + 450 / 2, Sin($rotation4 + $Pi / 2 + (2 * $Pi) / 3) * 25 + 450 / 2, Cos($rotation4 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 25 + 450 / 2, Sin($rotation4 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 25 + 450 / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation4 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 25 + 450 / 2, Sin($rotation4 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 25 + 450 / 2, Cos($rotation4 + $Pi / 2) * 25 + 450 / 2, Sin($rotation4 + $Pi / 2) * 25 + 450 / 2, $pen)
    $rotation5 += $Pi / 12.5
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation5 + $Pi / 2) * 12.5 + 450 / 2, Sin($rotation5 + $Pi / 2) * 12.5 + 450 / 2, Cos($rotation5 + $Pi / 2 + (2 * $Pi) / 3) * 12.5 + 450 / 2, Sin($rotation5 + $Pi / 2 + (2 * $Pi) / 3) * 12.5 + 450 / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation5 + $Pi / 2 + (2 * $Pi) / 3) * 12.5 + 450 / 2, Sin($rotation5 + $Pi / 2 + (2 * $Pi) / 3) * 12.5 + 450 / 2, Cos($rotation5 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 12.5 + 450 / 2, Sin($rotation5 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 12.5 + 450 / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, Cos($rotation5 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 12.5 + 450 / 2, Sin($rotation5 + $Pi / 2 + ((2 * $Pi) / 3) * 2) * 12.5 + 450 / 2, Cos($rotation5 + $Pi / 2) * 12.5 + 450 / 2, Sin($rotation5 + $Pi / 2) * 12.5 + 450 / 2, $pen)
    ; Ende der Zeichnungen und Berechnungen
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $bitmap, 0, 0, 450, 450) ; Das Zeichnen hat im Buffer stattgefunden. Damit das Ganze sichtbar wird, wird das Ganze in die Graphik kopiert
    Sleep(10)
    WEnd

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

    Func _Close()
    _GDIPlus_BrushDispose($brush); Löst das Pinselobjekt auf
    _GDIPlus_PenDispose($pen); Löst den Pinsel auf
    _GDIPlus_GraphicsDispose($backbuffer); Löst den Buffer auf
    _GDIPlus_BitmapDispose($bitmap); Löst die Bitmap auf
    _GDIPlus_GraphicsDispose($hGraphic); Löst die Graphic auf
    _GDIPlus_Shutdown(); Schließt die GDI+ dll
    WinClose($hwnd); Schließt das Fenster
    Exit; Beendet das Script
    EndFunc

    [/autoit]
    GDI+Beispiel: Drehende Quadrate
    [autoit]

    #include <GDIPlus.au3>

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

    Opt("GUIOnEventMode", 1); Setzt das Script in den OnEventModus

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

    Global $hGraphic, $bitmap, $backbuffer, $Pen, $brush
    Global $rotation1 = 0, $rotation2 = 0, $rotation3 = 0, $rotation4 = 0, $rotation5 = 0
    Global $Pi = 3.14159, _
    $pi_Div_180 = 4 * ATan(1) / 180, _
    $width = 450, _
    $height = 450

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

    Global $Size

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

    Global $x1, $x2, $x3, $x4, _
    $y1, $y2, $y3, $y4

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

    $hwnd = GUICreate("GDI+ Beispiel: Drehende Dreiecke", $width, $height, -1, -1); Erstellt ein Fenster
    GUISetBkColor(0x000000); Setzt die Hintergrundfarbe der GUI auf schwarz
    GUISetOnEvent(-3, "_Close"); Die Funktion '_Close' wird ausgeführt, wenn das Fenster geschlossen wird
    GUISetState(@SW_SHOW, $hwnd); Macht das Fenster sichtbar

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

    _GDIPlus_Startup(); Ladet die GDI+ dll
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hwnd) ; Erstelle GDI+ Objekt von der GUI (Grafik)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics(450, 450, $hGraphic) ; Erstelle Bitmap von der Grafik
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap) ; Erstelle Grafik Kontext von der Bitmap (dient für die Doppeltbufferung der Grafik, damit die Bewegungen flüssiger aussehen
    $pen = _GDIPlus_PenCreate(0, 1) ; Erstelle Stift mit der Stärke 1 Pixels
    _GDIPlus_PenSetColor($Pen, 0xFF00FF00) ; Setze Stiftfarbe
    $brush = _GDIPlus_BrushCreateSolid(0x10000000); Erstellt ein vollfarbiges Pinselobjekt

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

    While 1
    _GDIPlus_GraphicsFillRect($backbuffer, 0, 0, $width, $height, $brush); Überzeichnet den Buffer mit einem transparentem schwarz
    ; Ab hier werden die Quadrate im Buffer gezeichnet und berechnet
    $Size = 200; Setzt die Größe des Quadrates
    ; $rotation1 += $Pi / 5; Berechnet den Rotationswinkel
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos($rotation1 * $pi_Div_180) + $width / 2, $Size * Sin($rotation1 * $pi_Div_180) + $height / 2, $Size * Cos(($rotation1 + 90) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation1 + 90) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation1 + 90) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation1 + 90) * $pi_Div_180) + $height / 2, $Size * Cos(($rotation1 + 180) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation1 + 180) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation1 + 180) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation1 + 180) * $pi_Div_180) + $height / 2, $Size * Cos(($rotation1 + 270) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation1 + 270) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation1 + 270) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation1 + 270) * $pi_Div_180) + $height / 2, $Size * Cos($rotation1 * $pi_Div_180) + $width / 2, $Size * Sin($rotation1 * $pi_Div_180) + $height / 2, $pen)
    $Size = 140; Setzt die Größe des Quadrates
    $rotation2 -= $Pi / 3.75; Berechnet den Rotationswinkel
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos($rotation2 * $pi_Div_180) + $width / 2, $Size * Sin($rotation2 * $pi_Div_180) + $height / 2, $Size * Cos(($rotation2 + 90) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation2 + 90) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation2 + 90) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation2 + 90) * $pi_Div_180) + $height / 2, $Size * Cos(($rotation2 + 180) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation2 + 180) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation2 + 180) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation2 + 180) * $pi_Div_180) + $height / 2, $Size * Cos(($rotation2 + 270) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation2 + 270) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation2 + 270) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation2 + 270) * $pi_Div_180) + $height / 2, $Size * Cos($rotation2 * $pi_Div_180) + $width / 2, $Size * Sin($rotation2 * $pi_Div_180) + $height / 2, $pen)
    $Size = 100; Setzt die Größe des Quadrates
    $rotation3 += $Pi / 2.8125; Berechnet den Rotationswinkel
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos($rotation3 * $pi_Div_180) + $width / 2, $Size * Sin($rotation3 * $pi_Div_180) + $height / 2, $Size * Cos(($rotation3 + 90) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation3 + 90) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation3 + 90) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation3 + 90) * $pi_Div_180) + $height / 2, $Size * Cos(($rotation3 + 180) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation3 + 180) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation3 + 180) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation3 + 180) * $pi_Div_180) + $height / 2, $Size * Cos(($rotation3 + 270) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation3 + 270) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation3 + 270) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation3 + 270) * $pi_Div_180) + $height / 2, $Size * Cos($rotation3 * $pi_Div_180) + $width / 2, $Size * Sin($rotation3 * $pi_Div_180) + $height / 2, $pen)
    $Size = 70; Setzt die Größe des Quadrates
    $rotation4 -= $Pi / 2.109375; Berechnet den Rotationswinkel
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos($rotation4 * $pi_Div_180) + $width / 2, $Size * Sin($rotation4 * $pi_Div_180) + $height / 2, $Size * Cos(($rotation4 + 90) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation4 + 90) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation4 + 90) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation4 + 90) * $pi_Div_180) + $height / 2, $Size * Cos(($rotation4 + 180) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation4 + 180) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation4 + 180) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation4 + 180) * $pi_Div_180) + $height / 2, $Size * Cos(($rotation4 + 270) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation4 + 270) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation4 + 270) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation4 + 270) * $pi_Div_180) + $height / 2, $Size * Cos($rotation4 * $pi_Div_180) + $width / 2, $Size * Sin($rotation4 * $pi_Div_180) + $height / 2, $pen)
    $Size = 50; Setzt die Größe des Quadrates
    $rotation5 += $Pi / 1.58203125; Berechnet den Rotationswinkel
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos($rotation5 * $pi_Div_180) + $width / 2, $Size * Sin($rotation5 * $pi_Div_180) + $height / 2, $Size * Cos(($rotation5 + 90) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation5 + 90) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation5 + 90) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation5 + 90) * $pi_Div_180) + $height / 2, $Size * Cos(($rotation5 + 180) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation5 + 180) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation5 + 180) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation5 + 180) * $pi_Div_180) + $height / 2, $Size * Cos(($rotation5 + 270) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation5 + 270) * $pi_Div_180) + $height / 2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $Size * Cos(($rotation5 + 270) * $pi_Div_180) + $width / 2, $Size * Sin(($rotation5 + 270) * $pi_Div_180) + $height / 2, $Size * Cos($rotation5 * $pi_Div_180) + $width / 2, $Size * Sin($rotation5 * $pi_Div_180) + $height / 2, $pen)
    ; Ende der Zeichnungen und Berechnungen
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $bitmap, 0, 0, 450, 450) ; Das Zeichnen hat im Buffer stattgefunden. Damit das Ganze sichtbar wird, wird das Ganze in die Graphik kopiert
    Sleep(10)
    WEnd

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

    Func _Close()
    _GDIPlus_BrushDispose($brush); Löst das Pinselobjekt auf
    _GDIPlus_PenDispose($pen); Löst den Pinsel auf
    _GDIPlus_GraphicsDispose($backbuffer); Löst den Buffer auf
    _GDIPlus_BitmapDispose($bitmap); Löst die Bitmap auf
    _GDIPlus_GraphicsDispose($hGraphic); Löst die Graphic auf
    _GDIPlus_Shutdown(); Schließt die GDI+ dll
    WinClose($hwnd); Schließt das Fenster
    Exit; Beendet das Script
    EndFunc

    [/autoit]

    PS:
    Bei den Berechnungen hat mir mein Dad geholfen. :P

    Edit1:
    Pi ist jetzt eine Variable.

    Edit2:
    Hab jetzt auch noch ein Bispiel mit rotierenden Quadraten hinzugefügt. Danke an UEZ für seine Hilfe. :)

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%

    3 Mal editiert, zuletzt von H2112 (2. November 2009 um 17:11)

    • Offizieller Beitrag

    Sehr schön, gefällt mir. 8)

  • Danke für die positive Rückmeldung. :)

    Ich versuch mich gerade darann, das Ganze jetzt auch noch mit Vierecken zu machen, wird aber sicher noch eine Weile dauern.

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%

  • Coole Idee mit den Dreiecken :thumbup:

    Du könntest ein paar Konstanten definieren, damit du nicht immer das gleiche berechnest:
    z.B. 2*$pi oder $p/2, etc.

    Ich glaube, der GDI+ Hype ist ausgebrochen! 8o :rock:

    Gruß,
    UEZ ;)

    Hier was für rotierende Quadrate! Musst es sehr wahrscheinlich für deine Bedürfnisse noch anpassen!

    [autoit]


    Func Square($xx1, $yy1, $i) ;coded by UEZ
    Local $degree = 45
    Local Const $pi_Div_180 = 4 * ATan(1) / 180
    $x1 = $xx1 * Cos(($i + $degree + 0) * $pi_Div_180) + $width / 2
    $y1 = $yy1 * Sin(($i + $degree + 0) * $pi_Div_180) + $height / 2
    $x2 = $xx1 * Cos(($i + $degree + 90) * $pi_Div_180) + $width / 2
    $y2 = $yy1 * Sin(($i + $degree + 90) * $pi_Div_180) + $height / 2
    $x3 = $xx1 * Cos(($i + $degree + 180) * $pi_Div_180) + $width / 2
    $y3 = $yy1 * Sin(($i + $degree + 180) * $pi_Div_180) + $height / 2
    $x4 = $xx1 * Cos(($i + $degree + 270) * $pi_Div_180) + $width / 2
    $y4 = $yy1 * Sin(($i + $degree + 270) * $pi_Div_180) + $height / 2
    _GDIPlus_GraphicsDrawLine($GDI_Buffer, $x1, $y1, $x2, $y2, $Pen)
    _GDIPlus_GraphicsDrawLine($GDI_Buffer, $x2, $y2, $x3, $y3, $Pen)
    _GDIPlus_GraphicsDrawLine($GDI_Buffer, $x3, $y3, $x4, $y4, $Pen)
    _GDIPlus_GraphicsDrawLine($GDI_Buffer, $x4, $y4, $x1, $y1, $Pen)
    EndFunc

    [/autoit]

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

    2 Mal editiert, zuletzt von UEZ (31. Oktober 2009 um 15:37)

  • Joa das ist keine schlechte Idee, hab ich sofort umgesetzt. :D

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%

  • Danke. :)

    Hab jetzt noch ein Beispiel mit rotierenden Quadraten angehängt.

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%

  • Komisch, bei mir hängts das alles extrem stark, hat keiner das Problem??

    Glaub das liegt hier dran

    [autoit]

    $brush = _GDIPlus_BrushCreateSolid(0x10000000); Erstellt ein vollfarbiges Pinselobjekt

    [/autoit]

    Wenn ich das 10 auf FF stelle läuts wieder flüssig...

  • Komisch, bei mir hängts das alles extrem stark, hat keiner das Problem??

    Glaub das liegt hier dran

    [autoit]

    $brush = _GDIPlus_BrushCreateSolid(0x10000000); Erstellt ein vollfarbiges Pinselobjekt

    [/autoit]

    Wenn ich das 10 auf FF stelle läuts wieder flüssig...


    Schaue mal hier: [ gelöst ] Schlechte GDI+ Performance auf WinXP

    Liegt an der Kombination WinXP, Grafiktreiber und Alpha channel!

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Achso :/ ,

    Treiber sind bei mir leider alle schon Aktuell, ab dem Alpha Channel 80 läuft es nach 3 Sekunden gehänge aufeinmal flüssig, bei 79 hängt es dauerhaft, sehr komische Sachen, hoffe die fixen das mal.

  • Das is echt komisch. :/
    Naja kann man nur hoffen, dass das gefixt wird. :)

    Sleep hinzugefügt!

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%