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

Beiträge von Nestos

  • RichEdit - Eine bestimmte Zeile zentrieren

    • Nestos
    • 8. November 2009 um 16:26

    Edit2: Bitte im zweiten Post wegen der Frage schauen. Danke! ^^

    Ich bins wieder.

    Und gleich zu meiner Frage:
    Ich will einen bestimmten Text in einem RichEdit Controle verändern. Doch ich bekomme das irgendwie nicht hin.

    Würde mich über ein Beispiel freuen. :)

    Die UDF die ich benutze ist im Anhang.

    MfG
    H2112

    Edit:
    Ich hab das Problem lösen können. :)

    Hier die Funktion dafür:

    [autoit]

    ;====================================================================================================
    ; Function Name: _GUICtrlRichEdit_SetFontColor
    ; Description: Select the text color
    ; Parameters : $hWnd - Handle to the control
    ; $hColor - Color value HEX (BGR)
    ; $iSelect - Color entire text or selection (default)
    ; Return values : True on success, otherwise False
    ; Author : Yoan Roblet (Arcker)
    ; Rewritten : grham
    ; Notes :
    ;====================================================================================================
    ;
    Func _GUICtrlRichEdit_SetFontColor($hWnd, $hColor, $iSelec = False)
    Local $tCharFormat = DllStructCreate($tagCHARFORMAT2)
    DllStructSetData($tCharFormat, 1, DllStructGetSize($tCharFormat))
    DllStructSetData($tCharFormat, 2, $CFM_COLOR)
    DllStructSetData($tCharFormat, 6, $hColor)
    Local $iSelec2 = $SCF_ALL
    If $iSelec Then $iSelec2 = $SCF_SELECTION
    Return __GCR_SendMessage($hWnd, $EM_SETCHARFORMAT, $iSelec, DllStructGetPtr($tCharFormat))
    EndFunc ;==>_GUICtrlRichEdit_SetFontColor

    [/autoit]
  • AU Shoot (2D Shooter in AutoIt)

    • Nestos
    • 8. November 2009 um 16:08

    Ich mich würde mich auch als Beta Tester zur Verfügung stellen.

    Das ganze scheint interessant zu werden. ;)

  • GDI+ Beispiel: Drehende Dreiecke + Drehende Quadrate

    • Nestos
    • 2. November 2009 um 17:11

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

    Sleep hinzugefügt!

  • GDI+ Beispiel: Drehende Dreiecke + Drehende Quadrate

    • Nestos
    • 1. November 2009 um 15:49

    Danke. :)

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

  • GDI+ Beispiel: Drehende Dreiecke + Drehende Quadrate

    • Nestos
    • 31. Oktober 2009 um 15:34

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

  • GDI+ Beispiel: Drehende Dreiecke + Drehende Quadrate

    • Nestos
    • 31. Oktober 2009 um 15:28

    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.

  • GDI+ Beispiel: Drehende Dreiecke + Drehende Quadrate

    • Nestos
    • 31. Oktober 2009 um 15:18

    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. :)

  • Problem mit WS_EX_COMPOSITED

    • Nestos
    • 21. Oktober 2009 um 17:59

    Danke. :D
    Das funktioniert wunderbar.

    Thema gelöst!

  • Problem mit WS_EX_COMPOSITED

    • Nestos
    • 20. Oktober 2009 um 21:32

    @simon: Jetzt wird zwar etwas angezeigt, aber das flackern ist immer noch da.

  • Problem mit WS_EX_COMPOSITED

    • Nestos
    • 20. Oktober 2009 um 21:18

    Das ist irgendwie komisch. :/

    Kann mir denn jemand zeigen, wie das mit WS_EX_COMPOSITED funktionierd?

  • Problem mit WS_EX_COMPOSITED

    • Nestos
    • 20. Oktober 2009 um 21:00

    Ja Danke, das hat zwar nich mein Problem gelöst, aber hat in Erfahrung gebracht, dass Win XP anscheinend anders mit GDI+ arbeitet als Win Vista.

  • Problem mit WS_EX_COMPOSITED

    • Nestos
    • 20. Oktober 2009 um 20:50

    Danke für die schnelle Antwort. :)

    Ich hab Win XP ServicePack 3.

    Dein Script flackert genauso wie das meine.

  • Problem mit WS_EX_COMPOSITED

    • Nestos
    • 20. Oktober 2009 um 20:36

    Schönen Abend alle.

    Und hier gleich zu meinem Problem:

    Ich habe ein Script geschrieben, was einen String in GDI+ darstellt. Mit dem Hotkey 1 soll man das Bild bewegen können. Das klappt ja auch soweit ganz gut. Nur flackert es dann halt total. Ich hab es dann mit VM_COMPOSITED versucht, was aber nur zufolge hatte, dass garnichtsmehr angezeigt wird.

    Source ohne WS_EX_COMPOSITED
    [autoit]

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

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

    Global $Y = 0, _
    $dll = DllOpen("user32.dll")

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

    Global Const $WS_EX_COMPOSITED = 0x2000000

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

    HotKeySet("1", "_test")

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

    _GDIPlus_Startup()

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

    $hWnd = GUICreate("GDI+ Example", 300, 200, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU));, $WS_EX_COMPOSITED)
    GUISetState()

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

    GUIRegisterMsg(0xF, "MY_PAINT")

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

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    $hBrush = _GDIPlus_BrushCreateSolid(0xFF009900)
    $hFamily = _GDIPlus_FontFamilyCreate("Arial")
    $hFont = _GDIPlus_FontCreate($hFamily, 36)
    $hLayout = _GDIPlus_RectFCreate(0, 0, 300, 200)
    $hStringFormat = _GDIPlus_StringFormatCreate()
    _GDIPlus_StringFormatSetAlign($hStringFormat, 1)
    DllCall($dll, "lparam", "SendMessage", "hwnd", $hWnd, "int", 0xF, "wparam", 0, "lparam", 0)

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

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

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

    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_StringFormatDispose($hStringFormat)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()

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

    Func MY_PAINT($hWnd, $msg, $wParam, $lParam)
    DllCall($ghGDIPDll, "int", "GdipGraphicsClear", "hwnd", $hGraphics, "int", 0xFF000000)
    DllCall($ghGDIPDll, "int", "GdipDrawString", "hwnd", $hGraphics, "wstr", "AutoIT Rocks", "int", -1, "hwnd", $hFont, "ptr", DllStructGetPtr($hLayout), "hwnd", $hStringFormat, "hwnd", $hBrush)
    Return $GUI_RUNDEFMSG
    EndFunc ;==>MY_PAINT

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

    Func _test()
    $Y = $Y + 1
    $hLayout = _GDIPlus_RectFCreate(0, $Y, 300, 200)
    DllCall($dll, "lparam", "SendMessage", "hwnd", $hWnd, "int", 0x0000000F, "wparam", 0, "lparam", 0)
    EndFunc ;==>_test

    [/autoit]
    Source mit VS_EX_COMPOSITED
    [autoit]

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

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

    Global $Y = 0, _
    $dll = DllOpen("user32.dll")

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

    Global Const $WS_EX_COMPOSITED = 0x2000000

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

    HotKeySet("1", "_test")

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

    _GDIPlus_Startup()

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

    $hWnd = GUICreate("GDI+ Example", 300, 200, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), $WS_EX_COMPOSITED)
    GUISetState()

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

    GUIRegisterMsg(0xF, "MY_PAINT")

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

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    $hBrush = _GDIPlus_BrushCreateSolid(0xFF009900)
    $hFamily = _GDIPlus_FontFamilyCreate("Arial")
    $hFont = _GDIPlus_FontCreate($hFamily, 36)
    $hLayout = _GDIPlus_RectFCreate(0, 0, 300, 200)
    $hStringFormat = _GDIPlus_StringFormatCreate()
    _GDIPlus_StringFormatSetAlign($hStringFormat, 1)
    DllCall($dll, "lparam", "SendMessage", "hwnd", $hWnd, "int", 0xF, "wparam", 0, "lparam", 0)

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

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

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

    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_StringFormatDispose($hStringFormat)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()

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

    Func MY_PAINT($hWnd, $msg, $wParam, $lParam)
    DllCall($ghGDIPDll, "int", "GdipGraphicsClear", "hwnd", $hGraphics, "int", 0xFF000000)
    DllCall($ghGDIPDll, "int", "GdipDrawString", "hwnd", $hGraphics, "wstr", "AutoIT Rocks", "int", -1, "hwnd", $hFont, "ptr", DllStructGetPtr($hLayout), "hwnd", $hStringFormat, "hwnd", $hBrush)
    Return $GUI_RUNDEFMSG
    EndFunc ;==>MY_PAINT

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

    Func _test()
    $Y = $Y + 1
    $hLayout = _GDIPlus_RectFCreate(0, $Y, 300, 200)
    DllCall($dll, "lparam", "SendMessage", "hwnd", $hWnd, "int", 0x0000000F, "wparam", 0, "lparam", 0)
    EndFunc ;==>_test

    [/autoit]

    Danke schonmal für die Antworten!

    MfG,
    H2112

    Edit:
    Hab Win XP ServicPack 3

    Edit2:
    Problem hat sich gelöst, antwort im Vorletzten Post.

  • [spiel] Wünsch dir was !

    • Nestos
    • 24. September 2009 um 19:39

    Bekommst du, aber der Knopf ist defekt. xD

    Ich wünsch mir einen roten Knopf, wo fett drauf steht: "Drücken verboten!" und einen Ideoten der darauf drücken will. :P

  • [spiel] Wünsch dir was !

    • Nestos
    • 24. September 2009 um 19:27

    Bekommst sie, sind jedoch alle nur aus Pappe. :P

    Ich wünsch mir einen Computer der nicht aus Pappe ist. xD

  • [spiel] Wünsch dir was !

    • Nestos
    • 24. September 2009 um 19:20

    Bekommst ihn, die Flasche ist aber Verstopft. xD

    Ihc wünsch mir viel längere Ferien! :D

  • [spiel] Wünsch dir was !

    • Nestos
    • 24. September 2009 um 19:12

    Bekommst ihn, hast aber kein Auto. :P

    Ich wünsche mir viel. :D

  • Funktion aus einer Funktion ausführen

    • Nestos
    • 22. September 2009 um 20:22

    Danke für die schnelle Antwort, hab die Funktion anscheinend übersehen. :)

    Problem gelöst

    MfG H2112

  • Funktion aus einer Funktion ausführen

    • Nestos
    • 22. September 2009 um 20:10

    Ich wünsche allein einen guten Abend.

    Und jetzt gleich zu meiner Frage:
    Gibt es eine Funktion, die eine andere Funktion aufruft.

    In der Hilfe konnte ich eine derartige Funktion nicht entdecken, und in der SUFU ebensowenig.

    Die Funktion sollte als String an die Hauptfunktion übergeben werden können. Ungefähr so wie bei GUISetOnEvent.
    Beispiel:

    [autoit]

    $String = "_Exit"
    _Funktionsaufruf($String)

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

    Func _Exit()
    Exit
    EndFunc

    [/autoit]

    Ich danke euch schonmal für die Antworten.

    MfG H2112

  • Notenmanager, Schulnoten verwalten, Schnitte ausrechnen und mehr...Version 3.20

    • Nestos
    • 7. September 2009 um 11:47

    Ich würde den Code einfach mal ein bisschen sortieren und vll auch in den GUIOnEventMode umschreiben :)

    UZnd ich habs wohl gemerkt. 8|

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™