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

Beiträge von moritz1243

  • icon von verknüpfungen in gui darstellen

    • moritz1243
    • 29. April 2009 um 16:21

    Hallo zusammen,

    ich möchte in einer gui von datei xy das Icon (ohne es vorher zu extrahieren) darstellen, wie mache ich das?

    Spoiler anzeigen
    [autoit]

    GUICreate("TEst",640,400,-1,-1)

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


    $Button_1 = GUICtrlCreateButton("test", 20,20,20,20)

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

    GUISetState()

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

    sleep (5000ms)

    [/autoit]
  • icon eines Links in Gui darstellen

    • moritz1243
    • 15. April 2009 um 22:22

    Abend zusammen,

    wie kann ich das Icon vom z.B. VLC-Player in einer GUI darstellen ohne es vorher zu extrahieren?

  • _ispressed Ö ID

    • moritz1243
    • 1. April 2009 um 17:39

    haste oe probiert?

  • einen button über ein bild bwegen ohne flackern

    • moritz1243
    • 1. April 2009 um 17:37

    das hat den gleichen effekt, hatte ich schon versucht

  • einen button über ein bild bwegen ohne flackern

    • moritz1243
    • 1. April 2009 um 16:46

    Tag zusammen ,

    hier ist ein Auszug aus einer Funktion eines programmes von mir, ich möchte das die buttons von beiden seiten zusammen kommen und das dabei das hintergrundbild nicht flacker (am besten ohne eine neue gui für die button zu erstellen)

    Spoiler anzeigen


    Local $mGUI, $Button[2], $move_in

    $mGUI = GUICreate($Titel, 640, 375,0,25,$WS_POPUP, $WS_EX_TOPMOST + $WS_EX_MDICHILD + $WS_EX_LAYERED,$hGUI)
    GUISetBkColor (0xFFFFFF)
    GUICtrlCreatePic("BK.gif", 0, 0, 640, 400)
    GUICtrlSetState(-1, $GUI_DISABLE)


    $Button[0] = GUICtrlCreateButton ("1 Spieler",250,100,140,50)
    GUICtrlSetColor (-1,0xFF0000)
    GUICtrlSetFont(-1, 18, 400, 0, "Ellis")
    GUICtrlSetOnEvent (-1,"_info_button")
    $Button[1] = GUICtrlCreateButton ("2 Spieler",250,170,140,50)
    GUICtrlSetColor (-1,0xFF0000)
    GUICtrlSetFont(-1, 18, 400, 0, "Ellis")
    GUICtrlSetOnEvent (-1,"_info_button")

    GUISetState (@SW_SHOW)

    For $move_in = 0 To 400 Step 20

    ControlMove("","",$Button[0], -150 + $move_in, 100)
    ControlMove("","",$Button[1], 650 - $move_in, 170)

    Sleep (10)

    Next

  • Ein animiertes Gif im laufenden Betrieb als hintergrund setzen

    • moritz1243
    • 28. März 2009 um 23:48

    Abend wie der Name schon sagt ein .gif (ein animiertes) als Desktophintergrund setzten hier ist eine version aus dem forum die aber nicht mit gif funktioniert vllt kann sie jemand für gif patchen

    Spoiler anzeigen

    Global Const $SPIF_UPDATEINIFILE = 0x01
    Global Const $SPIF_SENDWININICHANGE = 0x02
    Global Const $SPI_SETSCREENSAVEACTIVE = 0x11
    Global Const $SPI_SETDESKWALLPAPER = 0x14
    Global Const $SPI_GETDESKWALLPAPER = 0x73

    Global $Bitmap = "C:\Dokumente und Einstellungen\Moritz\Desktop\affe.gif"

    RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "TileWallpaper", "REG_SZ", "0")
    RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "WallpaperStyle", "REG_SZ", "0")
    _SetDeskWallpaper($Bitmap)

    Func _SetDeskWallpaper($Filename)
    DllCall("user32.dll", "long", "SystemParametersInfo" _
    , "long", $SPI_SETDESKWALLPAPER _
    , "long", 0 _
    , "str", $Filename _
    , "long", BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDWININICHANGE) _
    )
    EndFunc ;==>_SetDeskWallpaper

    Func _GetDeskWallpaper()
    Local $Filename = DllStructCreate("char[256]")
    DllCall("user32.dll", "long", "SystemParametersInfo" _
    , "long", $SPI_GETDESKWALLPAPER _
    , "long", 255 _
    , "ptr", DllStructGetPtr($Filename) _
    , "long", 0 _
    )

    Return DllStructGetData($Filename, 1)
    EndFunc ;==>_GetDeskWallpaper

  • Collision von Kugeln berechnen

    • moritz1243
    • 28. März 2009 um 10:47

    das sollte von sowieso nen game werden jedoch muss dafür die kollision richtig funktionieren ;)

    Hier ist noch ne kleine Grafik von den Informationen die man hat für die Berechung:

    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    ich habe die Lösung jetzt gefunden

  • Collision von Kugeln berechnen

    • moritz1243
    • 27. März 2009 um 18:24

    Hier ist noch ne version

    Spoiler anzeigen

    #include <GuiConstants.au3>
    #include <GDIPlus.au3>
    #include <Misc.au3>

    HotKeySet("{ESC}", "_beenden")

    Opt('MustDeclareVars', 1)
    Opt('GuiOnEventMode', 1)
    Opt ('MouseCoordMode', 0 )


    Global $hGUI, $hWnd, $hGraphic, $Bitmap, $Buffer, $hPen, $msg
    Global $width = 640
    Global $height = 400
    Global $titel = "Titel"
    Global $version = " v1"
    Global $rotate, $x = 288, $y = 168, $schwung, $auto_radius = 32
    Global $ball_x = 400, $ball_y = 250, $ball_radius = 16, $ball_rotate, $ball_schwung
    Global $pi = 3.14159265358979
    Global $f,$w,$wi

    ;Global $dll = DllOpen("user32.dll")


    $hGUI = GUICreate($Titel & $version, $width, $height,-1,-1)
    $hWnd = WinGetHandle($Titel & $version)

    GUISetState(@SW_SHOW)

    ;GUISetCursor(16)invisible

    _GDIPlus_Startup ()

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
    $Bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic)
    $Buffer = _GDIPlus_ImageGetGraphicsContext($Bitmap)
    _GDIPlus_GraphicsSetSmoothingMode($Buffer, 4)
    _GDIPlus_GraphicsClear($Buffer,0xFF000000)
    $hPen = _GDIPlus_PenCreate (0xFF00FF00,4)

    While 1

    If $Rotate > 360 Then
    $Rotate -=360
    ElseIf $Rotate < 0 Then
    $Rotate +=360
    EndIf

    If _IsPressed ("27") Then
    $Rotate -= 5
    ElseIf _IsPressed ("25") Then
    $Rotate += 5
    EndIf
    If _IsPressed ("26") Then
    $schwung -= 0.1
    ElseIf _IsPressed ("28") Then
    $schwung += 0.1
    EndIf

    If $schwung >= 10 Then $schwung = 10
    If $schwung <= -10 Then $schwung = -10

    If $schwung < 0 Then $schwung += 0.01
    If $schwung > 0 Then $schwung -= 0.01

    ;##### Collision Seiten ################################################

    If $x <= 0 Then
    $rotate = -$rotate
    $x += 1
    EndIf
    If $x >= 576 Then
    $rotate = -$rotate
    $x -= 1
    EndIf

    If $y <= 0 Then
    $rotate += 90
    $rotate = -$rotate
    $rotate -= 90
    $y += 1
    EndIf
    If $y >= 336 Then
    $rotate += 90
    $rotate = -$rotate
    $rotate -= 90
    $y -= 1
    EndIf


    If $ball_x <= 0 Then
    $ball_rotate = -$ball_rotate
    $ball_x += 1
    EndIf
    If $ball_x >= 576 Then
    $ball_rotate = -$ball_rotate
    $ball_x -= 1
    EndIf

    If $ball_y <= 0 Then
    $ball_rotate += 90
    $ball_rotate = -$ball_rotate
    $ball_rotate -= 90
    $ball_y += 1
    EndIf
    If $ball_y >= 336 Then
    $ball_rotate += 90
    $ball_rotate = -$ball_rotate
    $ball_rotate -= 90
    $ball_y -= 1
    EndIf

    ;##### /Collision Seiten ###############################################

    ;#### Collision zwischen Auto und Kugel ###############################

    If (sqrt(($x -$ball_x)*($x-$ball_x)+($y-$ball_y)*($y-$ball_y))< 72) Then

    _collision ()

    EndIf

    ;#### /Collision zwischen Auto und Kugel ##############################

    $x += Sin (($rotate)*$Pi/180)*$schwung ;errechnet x
    $y += Cos (($rotate)*$Pi/180)*$schwung ;errechnet y

    $ball_x += Sin (($ball_rotate)*$Pi/180)*$ball_schwung ;errechnet x
    $ball_y += Cos (($ball_rotate)*$Pi/180)*$ball_schwung ;errechnet y

    $ball_schwung -= 0.01
    If $ball_schwung < 0 Then $ball_schwung = 0

    _zeichnen ()

    Sleep(10)
    WEnd

    Func _collision ()

    $ball_schwung = -$schwung

    Local $x1 ,$y1, $var1, $var2, $radToDeg = 180 / $pi

    $x1 = $ball_x - $x
    $y1 = $ball_y - $y

    $var1 = $x1 / 64
    $var2 = ACos ($var1) * $radToDeg
    $ball_rotate = $var2
    ToolTip ($x1 & " ; " & $y1 & " ; " & $var1 & " ; " & $var2 & " ; " & $rotate)

    If $rotate >= 0 And $rotate <= 180 Then $ball_rotate = -$ball_rotate

    EndFunc

    Func _zeichnen ()
    _GDIPlus_GraphicsClear($Buffer,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawPie ($Buffer,$x,$y,64,64,0 - $Rotate - 90,360,$hPen)
    _GDIPlus_GraphicsDrawPie ($Buffer,$ball_x,$ball_y,32,32,0 - $ball_Rotate - 90,360,$hPen)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $Bitmap,0,0, $width, $height)
    EndFunc

    Func _PointInEllipse($xPt, $yPt, $xTL, $yTL, $w, $h)
    Local $bInside = False, $a = $w / 2, $b = $h / 2
    Local $c1X, $c2X, $dist, $xc = $xTL + $a, $yc = $yTL + $b
    $c1X = $xc - ($a ^ 2 - $b ^ 2) ^ (1 / 2); 1st focal point x position
    $c2X = $xc + ($a ^ 2 - $b ^ 2) ^ (1 / 2); 2nd focal point x position
    $dist = (($xPt - $c1X) ^ 2 + ($yPt - $yc) ^ 2) ^ 0.5 + (($xPt - $c2X) ^ 2 + ($yPt - $yc) ^ 2) ^ 0.5
    If $dist <= $w Then $bInside = Not $bInside
    Return $bInside
    EndFunc ;==>_PointInEllipse


    Func _beenden ()

    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_BitmapDispose($Bitmap)
    _GDIPlus_GraphicsDispose($Buffer)
    _GDIPlus_PenDispose ($hPen)

    _GDIPlus_Shutdown ()

    ; DllClose ($dll)

    Exit

    EndFunc

  • Collision von Kugeln berechnen

    • moritz1243
    • 27. März 2009 um 18:00

    was meinst du den welche funktion? (ist von dir)

    die funktion von dir ist zwar gut jedoch habe ich breits errechnet ob die kugek übereinander liegen (If (sqrt(($x -$ball_x)*($x-$ball_x)+($y-$ball_y)*($y-$ball_y))< 32) Then) ich bruach nur die winkel in den die kugel voneinander abprallen aber trotzdem danke für deinen rat

  • Collision von Kugeln berechnen

    • moritz1243
    • 27. März 2009 um 17:48

    ja das geht sogar im richtigen winkel

    so ich habs jetzt geschaft das es einigermaßen geht aber noch ncitg richtig

    Spoiler anzeigen

    #include <GuiConstants.au3>
    #include <GDIPlus.au3>
    #include <Misc.au3>

    HotKeySet("{ESC}", "_beenden")

    Opt('MustDeclareVars', 1)
    Opt('GuiOnEventMode', 1)
    Opt ('MouseCoordMode', 0 )


    Global $hGUI, $hWnd, $hGraphic, $Bitmap, $Buffer, $hPen, $msg
    Global $width = 640
    Global $height = 400
    Global $titel = "Titel"
    Global $version = " v1"
    Global $rotate, $x = 288, $y = 168, $schwung, $auto_radius = 32
    Global $ball_x = 400, $ball_y = 250, $ball_radius = 16, $ball_rotate, $ball_schwung
    Global $pi = 3.14159265358979
    Global $f,$w,$wi

    ;Global $dll = DllOpen("user32.dll")


    $hGUI = GUICreate($Titel & $version, $width, $height,-1,-1)
    $hWnd = WinGetHandle($Titel & $version)

    GUISetState(@SW_SHOW)

    ;GUISetCursor(16)invisible

    _GDIPlus_Startup ()

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
    $Bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic)
    $Buffer = _GDIPlus_ImageGetGraphicsContext($Bitmap)
    _GDIPlus_GraphicsSetSmoothingMode($Buffer, 4)
    _GDIPlus_GraphicsClear($Buffer,0xFF000000)
    $hPen = _GDIPlus_PenCreate (0xFF00FF00,4)

    While 1

    If $Rotate > 360 Then
    $Rotate -=360
    ElseIf $Rotate < 0 Then
    $Rotate +=360
    EndIf

    If _IsPressed ("27") Then
    $Rotate -= 5
    ElseIf _IsPressed ("25") Then
    $Rotate += 5
    EndIf
    If _IsPressed ("26") Then
    $schwung -= 0.1
    ElseIf _IsPressed ("28") Then
    $schwung += 0.1
    EndIf

    If $schwung >= 10 Then $schwung = 10
    If $schwung <= -10 Then $schwung = -10

    If $schwung < 0 Then $schwung += 0.01
    If $schwung > 0 Then $schwung -= 0.01

    ;##### Collision Seiten ################################################

    If $x <= 0 Then
    $rotate = -$rotate
    $x += 1
    EndIf
    If $x >= 576 Then
    $rotate = -$rotate
    $x -= 1
    EndIf

    If $y <= 0 Then
    $rotate += 90
    $rotate = -$rotate
    $rotate -= 90
    $y += 1
    EndIf
    If $y >= 336 Then
    $rotate += 90
    $rotate = -$rotate
    $rotate -= 90
    $y -= 1
    EndIf

    ;##### /Collision Seiten ###############################################

    ;#### Collision zwischen Auto und Kugel ###############################

    If (sqrt(($x -$ball_x)*($x-$ball_x)+($y-$ball_y)*($y-$ball_y))< 32) Then

    _collision ()

    EndIf

    ;#### /Collision zwischen Auto und Kugel ##############################

    $x += Sin (($rotate)*$Pi/180)*$schwung ;errechnet x
    $y += Cos (($rotate)*$Pi/180)*$schwung ;errechnet y

    $ball_x += Sin (($ball_rotate)*$Pi/180)*$ball_schwung ;errechnet x
    $ball_y += Cos (($ball_rotate)*$Pi/180)*$ball_schwung ;errechnet y

    $ball_schwung -= 0.01
    If $ball_schwung < 0 Then $ball_schwung = 0

    _zeichnen ()

    Sleep(10)
    WEnd

    Func _collision ()

    $ball_schwung = 1

    Local $x1 ,$y1, $var1, $var2, $radToDeg = 180 / $pi

    $x1 = $ball_x - $x
    $y1 = $ball_y - $y

    $var1 = $x1 / 64
    $var2 = ACos ($var1) * $radToDeg
    $ball_rotate = $var2
    ToolTip ($x1 & " ; " & $y1 & " ; " & $var1 & " ; " & $var2 & " ; " & $rotate)

    If $rotate >= 0 And $rotate <= 180 Then $ball_rotate = -$ball_rotate

    EndFunc

    Func _zeichnen ()
    _GDIPlus_GraphicsClear($Buffer,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawPie ($Buffer,$x,$y,64,64,0 - $Rotate - 90,360,$hPen)
    _GDIPlus_GraphicsDrawPie ($Buffer,$ball_x,$ball_y,32,32,0 - $ball_Rotate - 90,360,$hPen)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $Bitmap,0,0, $width, $height)
    EndFunc


    Func _beenden ()

    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_BitmapDispose($Bitmap)
    _GDIPlus_GraphicsDispose($Buffer)
    _GDIPlus_PenDispose ($hPen)

    _GDIPlus_Shutdown ()

    ; DllClose ($dll)

    Exit

    EndFunc

  • Collision von Kugeln berechnen

    • moritz1243
    • 27. März 2009 um 17:18

    Hallo wie der name schon sagt geht es um Collisonen von Kugeln. Ich möchte für ein spiel das eine Kugel, die man frei bewegen kann einen ball anstößt und das dieser dann physikalisch richtig abprallt. Jedoch bekomme ich die rechung dafür nicht hin.

    Spoiler anzeigen

    #include <GuiConstants.au3>
    #include <GDIPlus.au3>
    #include <Misc.au3>

    HotKeySet("{ESC}", "_beenden")

    Opt('MustDeclareVars', 1)
    Opt('GuiOnEventMode', 1)
    Opt ('MouseCoordMode', 0 )


    Global $hGUI, $hWnd, $hGraphic, $Bitmap, $Buffer, $hPen, $msg
    Global $width = 640
    Global $height = 400
    Global $titel = "Titel"
    Global $version = " v1"
    Global $rotate, $x = 288, $y = 168, $schwung, $auto_radius = 32
    Global $ball_x = 400, $ball_y = 250, $ball_radius = 16, $ball_rotate, $ball_schwung
    Global $pi = 3.14159265358979
    Global $f,$w,$wi

    ;Global $dll = DllOpen("user32.dll")


    $hGUI = GUICreate($Titel & $version, $width, $height,-1,-1)
    $hWnd = WinGetHandle($Titel & $version)

    GUISetState(@SW_SHOW)

    ;GUISetCursor(16)invisible

    _GDIPlus_Startup ()

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
    $Bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic)
    $Buffer = _GDIPlus_ImageGetGraphicsContext($Bitmap)
    _GDIPlus_GraphicsSetSmoothingMode($Buffer, 4)
    _GDIPlus_GraphicsClear($Buffer,0xFF000000)
    $hPen = _GDIPlus_PenCreate (0xFF00FF00,4)

    While 1

    If $Rotate > 360 Then
    $Rotate -=360
    ElseIf $Rotate < 0 Then
    $Rotate +=360
    EndIf

    If _IsPressed ("27") Then
    $Rotate -= 5
    ElseIf _IsPressed ("25") Then
    $Rotate += 5
    EndIf
    If _IsPressed ("26") Then
    $schwung -= 0.1
    ElseIf _IsPressed ("28") Then
    $schwung += 0.1
    EndIf

    If $schwung >= 10 Then $schwung = 10
    If $schwung <= -10 Then $schwung = -10

    If $schwung < 0 Then $schwung += 0.01
    If $schwung > 0 Then $schwung -= 0.01

    ;##### Collision Seiten ################################################

    If $x <= 0 Then
    $rotate = -$rotate
    $x += 1
    EndIf
    If $x >= 576 Then
    $rotate = -$rotate
    $x -= 1
    EndIf

    If $y <= 0 Then
    $rotate += 90
    $rotate = -$rotate
    $rotate -= 90
    $y += 1
    EndIf
    If $y >= 336 Then
    $rotate += 90
    $rotate = -$rotate
    $rotate -= 90
    $y -= 1
    EndIf

    ;##### /Collision Seiten ###############################################

    ;#### Collision zwischen Auto und Kugel ###############################

    If (sqrt(($x-$ball_x)*($x-$ball_x)+($y-$ball_y)*($y-$ball_y))< 32) Then

    _collision ()

    EndIf

    ;#### /Collision zwischen Auto und Kugel ##############################

    $x += Sin (($rotate)*$Pi/180)*$schwung ;errechnet x
    $y += Cos (($rotate)*$Pi/180)*$schwung ;errechnet y

    $ball_x += Sin (($ball_rotate)*$Pi/180)*$ball_schwung ;errechnet x
    $ball_y += Cos (($ball_rotate)*$Pi/180)*$ball_schwung ;errechnet y

    $ball_schwung -= 0.01
    If $ball_schwung < 0 Then $ball_schwung = 0

    _zeichnen ()

    Sleep(10)
    WEnd

    Func _collision ()

    $ball_schwung = 1

    Local $x1 ,$y1, $var1, $var2, $radToDeg = 180 / $pi

    $x1 = $ball_x - $x
    $y1 = $ball_y - $y

    $var1 = $x1 / 64
    $var2 = ACos ($var1) * $radToDeg
    $ball_rotate = $var2
    ToolTip ($x1 & " ; " & $y1 & " ; " & $var1 & " ; " & $var2)

    EndFunc

    Func _zeichnen ()
    _GDIPlus_GraphicsClear($Buffer,0xFFFFFFFF)
    _GDIPlus_GraphicsDrawPie ($Buffer,$x,$y,64,64,0 - $Rotate - 90,360,$hPen)
    _GDIPlus_GraphicsDrawPie ($Buffer,$ball_x,$ball_y,32,32,0 - $ball_Rotate - 90,360,$hPen)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $Bitmap,0,0, $width, $height)
    EndFunc

    Func _beenden ()

    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_BitmapDispose($Bitmap)
    _GDIPlus_GraphicsDispose($Buffer)
    _GDIPlus_PenDispose ($hPen)

    _GDIPlus_Shutdown ()

    ; DllClose ($dll)

    Exit

    EndFunc

  • Einen Punkt auf den Desktop zeichen

    • moritz1243
    • 22. März 2009 um 10:39

    Es geht nur weiß ich nicht wie ich das mit dem ball machen soll, dass der rund ist.

    Spoiler anzeigen

    #include <GuiConstants.au3>
    #include <GDIPlus.au3>
    #include <Misc.au3>


    Global $width = 640
    Global $height = 400
    Global $titel = "Test"


    $hGUI = GUICreate($Titel, $width, $height,-1,-1)
    $hWnd = WinGetHandle($Titel)

    GUISetState()

    _GDIPlus_Startup ()

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
    $Bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic)
    $Buffer = _GDIPlus_ImageGetGraphicsContext($Bitmap)
    _GDIPlus_GraphicsSetSmoothingMode($Buffer, 4)
    _GDIPlus_GraphicsClear($Buffer,0xFF000000)
    $hPen = _GDIPlus_PenCreate (0xFF00FF00,4)
    $hBrush1 = _GDIPlus_BrushCreateSolid (0xFFFF0000)


    While 1

    _GDIPlus_GraphicsClear($Buffer, 0xFF000000)

    _GDIPlus_GraphicsFillEllipse($Buffer,10,10,100,100,$hBrush1)

    _GDIPlus_GraphicsDrawImageRect($hGraphic, $Bitmap,0,0, $width, $height)

    WEnd

    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_BitmapDispose($Bitmap)
    _GDIPlus_GraphicsDispose($Buffer)
    _GDIPlus_PenDispose ($hPen)
    _GDIPlus_BrushDispose($hBrush1)

    _GDIPlus_Shutdown ()

    Den hiermit ist der hintergrund ja schwarz und nicht durchsichtig?

  • Einen Punkt auf den Desktop zeichen

    • moritz1243
    • 22. März 2009 um 10:16

    Morgen zusammen,

    gib es eine Möglichkeit einen Punkt irgentwo auf den desktop zu zeichen und und zu bewegen am besten ohne gui. Ich habe bisher nur
    eine sehr prozessorlastige Möglichkeit gefunden die zudem keine runden objekte zeichen kann.

    Spoiler anzeigen

    #include <WindowsConstants.au3>
    #include <WinAPI.au3>

    Global $aButton[5],$i

    $gui = GUICreate("Test", 150, 150, @DesktopWidth-170, -1, $WS_POPUP, $WS_EX_TOPMOST)
    GUICtrlCreateIcon ("Ball1.ico","-1",0,0)
    GUISetState(@SW_SHOW)

    $pos = WinGetPos($gui)
    _GuiHole($gui, 0, 0, 150, 150)

    While 1
    WinMove("Test", "", 0 + $i, 0, 150, 150)
    $i += 0.01
    WEnd

    Func _GuiHole($h_win, $i_x, $i_y, $i_sizew, $i_sizeh)
    Local $outer_rgn, $inner_rgn, $combined_rgn
    $combined_rgn = _WinAPI_CreateRectRgn(0, 0, 0, 0)
    _WinAPI_DeleteObject($outer_rgn)
    _WinAPI_DeleteObject($inner_rgn)
    _AddCtrlRegion($combined_rgn, $aButton)
    _WinAPI_SetWindowRgn($h_win, $combined_rgn)
    EndFunc ;==>_GuiHole

    Func _AddCtrlRegion($full_rgn, $ctrl_id)
    Local $ctrl_pos, $ctrl_rgn
    If IsArray($ctrl_id) Then
    For $i = 0 To UBound($ctrl_id) -1
    $ctrl_pos = ControlGetPos($gui, "", $ctrl_id[$i])
    $ctrl_rgn = _WinAPI_CreateRectRgn($ctrl_pos[0], $ctrl_pos[1], $ctrl_pos[0] + $ctrl_pos[2], $ctrl_pos[1] + $ctrl_pos[3])
    _WinAPI_CombineRgn($full_rgn, $full_rgn, $ctrl_rgn, $RGN_OR)
    _WinAPI_DeleteObject($ctrl_rgn)
    Next
    Else
    $ctrl_pos = ControlGetPos($gui, "", $ctrl_id)
    $ctrl_rgn = _WinAPI_CreateRectRgn($ctrl_pos[0], $ctrl_pos[1], $ctrl_pos[0] + $ctrl_pos[2], $ctrl_pos[1] + $ctrl_pos[3])
    _WinAPI_CombineRgn($full_rgn, $full_rgn, $ctrl_rgn, $RGN_OR)
    _WinAPI_DeleteObject($ctrl_rgn)
    EndIf
    EndFunc

  • eine anzeigen wie fraps

    • moritz1243
    • 1. März 2009 um 02:14

    ich habe nur das heir gefunden und das verstehe ich nicht außerdem scheint es für winamp zu sein

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

    [/autoit]

    #NoTrayIcon

    AutoItSetOption("TrayMenuMode",1)
    dim $Title,$OldTitle
    dim $song
    dim $hwnd

    $exititem = TrayCreateItem("Exit")
    TraySetState()
    $hwnd = GUICreate("Winamp Tool",500,20,(@DesktopWidth-550),1,$WS_POPUP,BitOR($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW))
    GUISetBkColor(0xFF0000)
    GUISetState()

    While 1
    $msg = TrayGetMsg()
    Select
    Case $msg = $exititem
    ExitLoop
    EndSelect
    $OldTitle=$Title
    AutoItSetOption("WinTitleMatchMode", 4)

    $Title=WinGetTitle("classname=Winamp v1.x")
    if $OldTitle<>$Title then
    $song=ParseTitle($Title)
    $rgn = CreateTextRgn($hwnd,$song,20,"Arial",1000)
    SetWindowRgn($hwnd,$rgn)
    EndIf
    WEnd
    Func ParseTitle($Title)
    $loc=StringInstr($Title,". ")
    $ParsedTitle=StringTrimLeft($Title,$loc+1)
    $loc=StringInstr($ParsedTitle," - Winamp",0,-1)
    $ParsedTitle=StringLeft($ParsedTitle,$loc)
    Return $ParsedTitle
    EndFunc
    Func SetWindowRgn($h_win, $rgn)
    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)
    EndFunc

    ;Func CombineRgn(ByRef $rgn1, ByRef $rgn2)
    ; DllCall("gdi32.dll", "long", "CombineRgn", "long", $rgn1, "long", $rgn1, "long", $rgn2, "int", 2)
    ;EndFunc

    Func CreateTextRgn(ByRef $CTR_hwnd,$CTR_Text,$CTR_height,$CTR_font="Microsoft Sans Serif",$CTR_weight=1000)
    Local Const $ANSI_CHARSET = 0
    Local Const $OUT_CHARACTER_PRECIS = 2
    Local Const $CLIP_DEFAULT_PRECIS = 0
    Local Const $PROOF_QUALITY = 2
    Local Const $FIXED_PITCH = 1
    Local Const $RGN_XOR = 3

    If $CTR_font = "" Then $CTR_font = "Microsoft Sans Serif"
    If $CTR_weight = -1 Then $CTR_weight = 1000
    Local $gdi_dll = DLLOpen("gdi32.dll")
    Local $CTR_hDC= DLLCall("user32.dll","int","GetDC","hwnd",$CTR_hwnd)
    Local $CTR_hMyFont = DLLCall($gdi_dll,"hwnd","CreateFont","int",$CTR_height,"int",0,"int",0,"int",0, _
    "int",$CTR_weight,"int",0,"int",0,"int",0,"int",$ANSI_CHARSET,"int",$OUT_CHARACTER_PRECIS, _
    "int",$CLIP_DEFAULT_PRECIS,"int",$PROOF_QUALITY,"int",$FIXED_PITCH,"str",$CTR_font )
    Local $CTR_hOldFont = DLLCall($gdi_dll,"hwnd","SelectObject","int",$CTR_hDC[0],"hwnd",$CTR_hMyFont[0])
    DLLCall($gdi_dll,"int","BeginPath","int",$CTR_hDC[0])
    DLLCall($gdi_dll,"int","TextOut","int",$CTR_hDC[0],"int",0,"int",0,"str",$CTR_Text,"int",StringLen($CTR_Text))
    DLLCall($gdi_dll,"int","EndPath","int",$CTR_hDC[0])
    Local $CTR_hRgn1 = DLLCall($gdi_dll,"hwnd","PathToRegion","int",$CTR_hDC[0])
    Local $CTR_rc = DLLStructCreate("int;int;int;int")
    DLLCall($gdi_dll,"int","GetRgnBox","hwnd",$CTR_hRgn1[0],"ptr",DllStructGetPtr($CTR_rc))
    Local $CTR_hRgn2 = DLLCall($gdi_dll,"hwnd","CreateRectRgnIndirect","ptr",DllStructGetPtr($CTR_rc))
    DLLCall($gdi_dll,"int","CombineRgn","hwnd",$CTR_hRgn2[0],"hwnd",$CTR_hRgn2[0],"hwnd",$CTR_hRgn1[0],"int",$RGN_XOR)
    DLLCall($gdi_dll,"int","DeleteObject","hwnd",$CTR_hRgn1[0])
    DLLCall("user32.dll","int","ReleaseDC","hwnd",$CTR_hwnd,"int",$CTR_hDC[0])
    DLLCall($gdi_dll,"int","SelectObject","int",$CTR_hDC[0],"hwnd",$CTR_hOldFont[0])
    DLLClose($gdi_dll)
    Return $CTR_hRgn2[0]
    EndFunc


    [autoit][/autoit]
  • eine anzeigen wie fraps

    • moritz1243
    • 1. März 2009 um 01:16

    da war aber keine lösung ich habe dort schon geguckt

  • eine anzeigen wie fraps

    • moritz1243
    • 1. März 2009 um 01:14

    Hier mit diesem Bsp geht es auch nicht:

    Spoiler anzeigen

    #include <WindowsConstants.au3>

    WinSetOnTop("Crysis", "", 0)

    GUICreate("Test",@DesktopWidth / 2.5,@DesktopHeight / 2.5,-1,-1, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x000000)
    GUISetState()

    WinSetOnTop("Test", "", 1)

    While 1
    Sleep (200)
    WinSetOnTop("Crysis", "", 0)
    WinSetOnTop("Test", "", 1)
    WEnd

  • eine anzeigen wie fraps

    • moritz1243
    • 1. März 2009 um 01:01

    hab ich schon versucht geht nciht die spiele sind trotdem im vordergrund

  • eine anzeigen wie fraps

    • moritz1243
    • 1. März 2009 um 00:55

    setzen sich die spiele nicht von selber noch weiter in den vordergrund

  • eine anzeigen wie fraps

    • moritz1243
    • 1. März 2009 um 00:47

    abend zusammen,

    wie kann man mit autoit eine gui immer im vordergrund lassen auch bei spielen, so wie fraps das macht

  • _GDIPlus_GraphicsDrawString in Farbe

    • moritz1243
    • 22. Februar 2009 um 20:15

    muss dass dann so aussehen:
    $hBrush = _GDIPlus_BrushCreateSolid(0xFFEE9922)
    _GDIPlus_GraphicsDrawString ($hbrush, "Hello world", 10, 115,"Arial",10,0)
    _GDIPlus_GraphicsDrawImageRect($Graphic, $hbrush, 0, 0, $width, $height) ;copy to bitmap

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™