Durchsichtige Ellipse mit GDI+

  • Lag am Style

    So gehts:

    Spoiler anzeigen
    [autoit]

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

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

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

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

    $my_gui = GUICreate("MyGUI", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP,BitOR( $WS_EX_TOPMOST,$WS_EX_LAYERED))
    GUISetState(@SW_SHOW)
    _WinAPI_SetLayeredWindowAttributes($my_gui, 0xABCDEF, 255)
    $g1 = GUICtrlCreateGraphic(0,0,@DesktopWidth,@DesktopHeight)
    GUICtrlSetBkColor($g1, 0x000000)
    GUICtrlSetGraphic($g1, $GUI_GR_COLOR,0xABCDEF, 0xABCDEF)
    GUICtrlSetGraphic($g1, $GUI_GR_ELLIPSE, @DesktopWidth/16, @DesktopHeight/8, @DesktopWidth/1.15, @DesktopHeight/1.30)
    GUICtrlSetGraphic($g1, $GUI_GR_REFRESH)

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

    While 1
    Sleep (100)
    WEnd

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

    Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
    ; progandy
    If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
    If Not $isColorRef Then
    $i_transcolor = Hex(String($i_transcolor), 6)
    $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
    EndIf
    Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
    Select
    Case @error
    Return SetError(@error, 0, 0)
    Case $Ret[0] = 0
    Return SetError(4, _WinAPI_GetLastError(), 0)
    Case Else
    Return 1
    EndSelect
    EndFunc ;==>_WinAPI_SetLayeredWindowAttributes

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

    Func _Exit()
    Exit
    EndFunc

    [/autoit]
  • thx, funktioniert super ^^
    Wie schaff ich jetzt, dass die Ellipse verschwindet oder verformt wird?

    Das in der Hilfe versteh ich nicht wirklich :/

    Edit: Sry dummer Post.

    Die Lösung is GUICtrlDelete...

    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%

  • Jetzt hab ich das Problem, dass wenn ich die Ellipse langsam schließen will, alles flimmert.

    Script:

    Spoiler anzeigen
    [autoit]

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

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

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

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

    Global $i = 0
    Global $Sicherheit1 = 0

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

    $my_gui = GUICreate("MyGUI", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP,BitOR( $WS_EX_TOPMOST,$WS_EX_LAYERED))
    GUISetBkColor(0x000000)
    GUISetState(@SW_SHOW)

    _WinAPI_SetLayeredWindowAttributes($my_gui, 0xABCDEF, 255)

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

    For $i = 0 To @DesktopWidth/2 - @DesktopHeight/1.30 Step 1
    _DrawTransparentEllipse()
    GUICtrlDelete ($g1)
    Next

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

    While 1
    Sleep (100)
    WEnd

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

    Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
    ; progandy
    If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
    If Not $isColorRef Then
    $i_transcolor = Hex(String($i_transcolor), 6)
    $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
    EndIf
    Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
    Select
    Case @error
    Return SetError(@error, 0, 0)
    Case $Ret[0] = 0
    Return SetError(4, _WinAPI_GetLastError(), 0)
    Case Else
    Return 1
    EndSelect
    EndFunc ;==>_WinAPI_SetLayeredWindowAttributes

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

    Func _Exit()
    Exit
    EndFunc

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

    Func _DrawTransparentEllipse()
    $g1 = GUICtrlCreateGraphic(0,0,@DesktopWidth,@DesktopHeight)
    GUICtrlSetBkColor($g1, 0x000000)
    GUICtrlSetGraphic($g1, $GUI_GR_COLOR,0xABCDEF, 0xABCDEF)
    GUICtrlSetGraphic($g1, $GUI_GR_ELLIPSE, @DesktopWidth/16, @DesktopHeight/8 - $i, @DesktopWidth/1.15, @DesktopHeight/1.30 - $i)
    GUICtrlSetGraphic($g1, $GUI_GR_REFRESH)
    GUICtrlSetGraphic($g1, $GUI_GR_LINE, 1, 1)
    EndFunc

    [/autoit]
    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%

  • Ich hab da mal ne UDF jetzt für geschrieben:

    _DrawTransparentEllipse/Rect

    Musst bissel ausprobieren wie du das machst, hab jetzt keine Zeit mehr hab den ganzen Abend dadran gehongen und muss jetzt schlafen ;)

    Noch nen Hinweis:
    GUICtrlSetGraphic gibt es auch noch $GUI_GR_MOVE x,y Move the current position without drawing. Vieleicht damit.

    Gute Nacht^^

  • ich will ja auch die Graphik verkleinern. Ich will sie nicht nur verschieben ;)

    Edit: Kennt irgendwer eine Funktion die das übernimmt?

    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%

    Einmal editiert, zuletzt von H2112 (23. April 2009 um 20:29)

  • Mir fällt da nur löschen und neuzeichnen ein, leider flimmert das aber mit meiner UDF wenn du es oft machst =/

    Vieleicht kann man es löschen ohne das es so flimmer, aber hab dafür noch nix gefunden, ich probiers morgen nochmal.

  • Man müsste die nächste vorher zeichnen und die vorherige dann erst löschen. Dann gibt es kein flimmern.
    Wüsste aber nicht wie man das anstellen sollte...

    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%

  • Also die vor zu zeichnen ist eigentlich kein Problem, aber hab keinen Befehl der die einzeln Hide und Show macht, es geht nur mit dem ganzen GUI

    Spoiler anzeigen
    [autoit]

    Global $big=200
    Global $buffer[$big+1]

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

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    $gui=GUICreate ( "Transparent Ellipse and Rect", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR( $WS_EX_TOPMOST, $WS_EX_LAYERED ) )
    GUISetBkColor ( 0x000000 )
    GUICtrlCreateLabel("", 0, 0, 420, 500, -1, $GUI_WS_EX_PARENTDRAG)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUISetState (@SW_HIDE)

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

    For $i=0 To $big Step +1
    $buffer[$i]=_DrawTransparentEllipse ( $gui, @DesktopWidth/2-400, @DesktopHeight/2-300, 750+$i, 500+$i )
    Next
    GUISetState (@SW_SHOW)

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

    ;~ GUICtrlSetState()

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

    While 1
    $msg=GUIGetMsg()
    Switch $msg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

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

    Func _DeletTransparentForm ( $Form )
    $a=GUICtrlDelete ( $Form )
    Return $a
    EndFunc

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

    Func _DrawTransparentLine($hwnd, $X,$Y,$length,$course,$pensize=2,$Transparency=255)
    _WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency)
    $g1=GUICtrlCreateGraphic($X,$Y,0,0)
    GUICtrlSetGraphic($g1, $GUI_GR_PENSIZE, $pensize )
    GUICtrlSetGraphic($g1, $GUI_GR_COLOR,0xABCDEF, 0xABCDEF)
    GUICtrlSetGraphic($g1, $GUI_GR_LINE, $length, $course)
    GUICtrlSetGraphic($g1, $GUI_GR_REFRESH)
    GUICtrlSetGraphic($g1, $GUI_GR_LINE, 1, 1)
    Return $g1
    EndFunc

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

    Func _DrawTransparentRect($hwnd, $x,$y,$w,$h,$Transparency=255, $RectBorderColor=0xABCDEF)
    _WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency)
    $g1=GUICtrlCreateGraphic(0,0,0,0)
    GUICtrlSetGraphic($g1, $GUI_GR_COLOR,$RectBorderColor, 0xABCDEF)
    GUICtrlSetGraphic($g1, $GUI_GR_RECT, $x, $y, $w, $h)
    GUICtrlSetGraphic($g1, $GUI_GR_REFRESH)
    GUICtrlSetGraphic($g1, $GUI_GR_LINE, 1, 1)
    Return $g1
    EndFunc

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

    Func _DrawTransparentEllipse($hwnd, $x,$y,$w,$h,$Transparency=255,$EllipseBorderColor=0xABCDEF)
    _WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency)
    $g1=GUICtrlCreateGraphic(0,0,0,0)
    GUICtrlSetGraphic($g1, $GUI_GR_COLOR,$EllipseBorderColor, 0xABCDEF)
    $g2=GUICtrlSetGraphic($g1, $GUI_GR_ELLIPSE, $x, $y, $w, $h)
    GUICtrlSetGraphic($g1, $GUI_GR_REFRESH)
    GUICtrlSetGraphic($g1, $GUI_GR_LINE, 1, 1)
    Return $g2
    EndFunc

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

    Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
    ; progandy
    If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
    If Not $isColorRef Then
    $i_transcolor = Hex(String($i_transcolor), 6)
    $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
    EndIf
    Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
    Select
    Case @error
    Return SetError(@error, 0, 0)
    Case $Ret[0] = 0
    Return SetError(4, _WinAPI_GetLastError(), 0)
    Case Else
    Return 1
    EndSelect
    EndFunc ;==>_WinAPI_SetLayeredWindowAttributes

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

    Func _WinAPI_GetLastError()
    Local $aResult

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

    $aResult = DllCall("Kernel32.dll", "int", "GetLastError")
    If @error Then Return SetError(@error, 0, 0)
    Return $aResult[0]
    EndFunc ;==>_WinAPI_GetLastError

    [/autoit]
  • :/

    Ich hab wirklich keine Ahnung wie man das machen soll

    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%

    Einmal editiert, zuletzt von H2112 (24. April 2009 um 17:58)

  • Endlich hab ichs raus =D

    Muss aber alles nochma umschreiben, da die Methode GuiCtrlCreateGraphic garnicht mehr benutzt.
    Dauert nen bissel, aber auch gerade net viel Zeit also rechne erstma morgen damit.

    Hier nen kleiner vorgeschmack ;)

    Spoiler anzeigen
    [autoit]

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

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

    $Form1 = GUICreate("Test", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR ($WS_EX_TOPMOST, $WS_EX_LAYERED))
    GUISetBkColor ( 0x000000 )
    GUISetState()

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

    For $i=0 To 300 Step +1
    _DrawTransparentRect ( $Form1, 20, 20, 1+$i, 1+$i )
    Next

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

    While 1
    $msg=GUIGetMsg()
    Switch $msg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

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

    Func _DrawTransparentRect($hwnd, $x,$y,$w,$h,$Transparency=255)
    $Child=GUICreate ( "", $w, $h, $x, $y, $WS_CHILD, -1, $hwnd )
    _WinAPI_SetLayeredWindowAttributes($Form1, 0xABCDEF, $Transparency)
    GUISetBkColor ( 0xABCDEF, $Child )
    GUISetState()
    Return $Child
    EndFunc

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

    Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
    ; progandy
    If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
    If Not $isColorRef Then
    $i_transcolor = Hex(String($i_transcolor), 6)
    $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
    EndIf
    Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
    Select
    Case @error
    Return SetError(@error, 0, 0)
    Case $Ret[0] = 0
    Return SetError(4, _WinAPI_GetLastError(), 0)
    Case Else
    Return 1
    EndSelect
    EndFunc ;==>_WinAPI_SetLayeredWindowAttributes

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

    Func _WinAPI_GetLastError()
    Local $aResult

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

    $aResult = DllCall("Kernel32.dll", "int", "GetLastError")
    If @error Then Return SetError(@error, 0, 0)
    Return $aResult[0]
    EndFunc ;==>_WinAPI_GetLastError

    [/autoit]

    Wenn er fertig ist und du ESC drückst, löscht er erst alle Child GUI zuerst, sieht gut aus :)

  • Hey, das sieht richtig gut aus. :D

    Sehr gute Arbeit!

    Schau mir das mal für Ellipse an...

    Edit: Ne Frage:
    Wie hast du das mit esc gemacht?

    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%

    Einmal editiert, zuletzt von H2112 (24. April 2009 um 22:09)

  • Euch ist aber klar, das ich mal eben in 5 sekunden 300 Guis erstellt? :P Also jedenfalls bei mir geht die CPU direkt auf 100%.. mach das lieber so das du die Childs in nem Array erstellt und immer nach dem erstellen von ner neuen gui die letzte löscht..

  • Euch ist aber klar, das ich mal eben in 5 sekunden 300 Guis erstellt? :P Also jedenfalls bei mir geht die CPU direkt auf 100%.. mach das lieber so das du die Childs in nem Array erstellt und immer nach dem erstellen von ner neuen gui die letzte löscht..

    ja ist schon klar^^

    hab das nur schnell gemacht, muss jetzt erstma die neuen UDFs schreiben =)

  • Ich hab einfach mal für euch eine halbwegs gute verwendung für das script gefunden ;P

    Spoiler anzeigen
    [autoit]

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

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

    Dim $Child[301]
    Global $i = 0, $PosBuff, $w = 100, $h = 100
    $Form1 = GUICreate("Test", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR ($WS_EX_TOPMOST, $WS_EX_LAYERED))
    GUISetBkColor ( 0x000000 )
    GUISetState()
    $Pos = MouseGetPos()
    _DrawTransparentRect($Form1, $Pos[0]-($w/2),$Pos[1]-($h/2),$w,$h, 100)

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

    While 1
    sleep(10)
    $Pos = MouseGetPos()
    If $PosBuff <> $Pos Then
    _DrawTransparentRect ($Form1, $Pos[0]-($w/2),$Pos[1]-($h/2),$w,$h, 100)
    EndIf
    $msg=GUIGetMsg()
    Switch $msg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    If _isPressed("BB") Then
    _expand()
    EndIf
    If _isPressed("BD") Then
    _shrink()
    EndIf
    If _isPressed("01") Then
    _ScreenCapture_Capture(@ScriptDir & "\" & $i &".jpg", $Pos[0]-($w/2), $Pos[1]-($h/2), $w + $Pos[0]-($w/2), $h + $Pos[1]-($h/2))
    EndIf
    $Pos = $PosBuff
    WEnd

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

    Func _DrawTransparentRect($hwnd, $x,$y,$w,$h,$Transparency=255)
    $i += 1
    If $i = 301 Then
    $i = 1
    GuiDelete($Child[300])
    EndIf
    If $Transparency > 255 Then $Transperency = 255
    $Child[$i] =GUICreate ( "", $w, $h, $x, $y, $WS_CHILD, -1, $hwnd )
    _WinAPI_SetLayeredWindowAttributes($Form1, 0xABCDEF, $Transparency)
    GUISetBkColor ( 0xABCDEF, $Child[$i] )
    GUISetState()
    sleep(10)
    If $i <> 0 Then
    GuiDelete($Child[$i-1])
    EndIf
    Return $Child
    EndFunc

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

    Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
    ; progandy
    If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
    If Not $isColorRef Then
    $i_transcolor = Hex(String($i_transcolor), 6)
    $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
    EndIf
    Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
    Select
    Case @error
    Return SetError(@error, 0, 0)
    Case $Ret[0] = 0
    Return SetError(4, _WinAPI_GetLastError(), 0)
    Case Else
    Return 1
    EndSelect
    EndFunc ;==>_WinAPI_SetLayeredWindowAttributes

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

    Func _expand()
    $Pos = MouseGetPos()
    If $w < 391 And $h < 391 Then
    $w += 10
    $h += 10
    _DrawTransparentRect($Form1, $Pos[0]-($w/2),$Pos[1]-($h/2),$w,$h, 100)
    GuiDelete($Child[$i-1])
    EndIf
    EndFunc

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

    Func _shrink()
    $Pos = MouseGetPos()
    If $w > 11 And $h > 11 Then
    $w -= 10
    $h -= 10
    _DrawTransparentRect($Form1, $Pos[0]-($w/2),$Pos[1]-($h/2),$w,$h, 100)
    EndIf
    EndFunc

    [/autoit]
  • Hehe^^

    So _DrawTransparentEllipse hab ich jetzt auch so umgesetzt, warn bissel schwerer.

    Hier gleich mit dynamischen Beispiel :)

    Spoiler anzeigen
    [autoit]

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

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

    Global $Anzahl=150
    Global $Ellipse[$Anzahl]

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

    $Form1 = GUICreate("Test", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR ($WS_EX_TOPMOST, $WS_EX_LAYERED))
    GUISetBkColor ( 0x000000 )
    GUISetState()

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

    For $i=0 To $Anzahl-1 Step +1
    $Ellipse[$i]=_DrawTransparentEllipse ( $Form1, @DesktopWidth/2-200+$i, @DesktopHeight/2-200+$i, 1+$i, 1+$i )
    Next

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

    For $i=149 To 100 Step -1
    GUIDelete($Ellipse[$i])
    Next

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

    While 1
    $msg=GUIGetMsg()
    Switch $msg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

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

    Func _DrawTransparentEllipse($hwnd, $x,$y,$w,$h,$Transparency=255)
    $Child=GUICreate ( "", $w, $h, $x, $y, $WS_CHILD, -1, $hwnd )
    _WinAPI_SetLayeredWindowAttributes($Form1, 0xABCDEF, $Transparency)
    GUISetBkColor ( 0xABCDEF, $Child )
    _GuiRoundCorners ( $Child, 0, 0, $w, $h)
    GUISetState()
    Return $Child
    EndFunc

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

    Func _DrawTransparentRect($hwnd, $x,$y,$w,$h,$Transparency=255)
    $Child=GUICreate ( "", $w, $h, $x, $y, $WS_CHILD, -1, $hwnd )
    _WinAPI_SetLayeredWindowAttributes($Form1, 0xABCDEF, $Transparency)
    GUISetBkColor ( 0xABCDEF, $Child )
    GUISetState()
    Return $Child
    EndFunc

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

    Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
    ; progandy
    If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
    If Not $isColorRef Then
    $i_transcolor = Hex(String($i_transcolor), 6)
    $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
    EndIf
    Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
    Select
    Case @error
    Return SetError(@error, 0, 0)
    Case $Ret[0] = 0
    Return SetError(4, _WinAPI_GetLastError(), 0)
    Case Else
    Return 1
    EndSelect
    EndFunc ;==>_WinAPI_SetLayeredWindowAttributes

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

    Func _WinAPI_GetLastError()
    Local $aResult

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

    $aResult = DllCall("Kernel32.dll", "int", "GetLastError")
    If @error Then Return SetError(@error, 0, 0)
    Return $aResult[0]
    EndFunc ;==>_WinAPI_GetLastError

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

    Func _GuiRoundCorners($hWnd, $x1, $y1, $x3, $y3)
    Local $pos, $ret, $ret2
    $pos = WinGetPos($hWnd)
    $ret = DllCall('gdi32.dll', 'long', 'CreateRoundRectRgn', 'long', $x1, 'long', $y1, 'long', $pos[2], 'long', $pos[3], 'long', $x3, 'long', $y3)
    If $ret[0] Then
    $ret2 = DllCall('user32.dll', 'long', 'SetWindowRgn', 'hwnd', $hWnd, 'long', $ret[0], 'int', 1)
    If $ret2[0] Then
    Return 1
    Else
    Return 0
    EndIf
    Else
    Return 0
    EndIf
    EndFunc

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

    Func _DrawTransparentLine($hwnd, $X,$Y,$length,$course,$pensize=2,$Transparency=255)
    _WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency)
    $g1=GUICtrlCreateGraphic($X,$Y,0,0)
    GUICtrlSetGraphic($g1, $GUI_GR_PENSIZE, $pensize )
    GUICtrlSetGraphic($g1, $GUI_GR_COLOR,0xABCDEF, 0xABCDEF)
    GUICtrlSetGraphic($g1, $GUI_GR_LINE, $length, $course)
    GUICtrlSetGraphic($g1, $GUI_GR_REFRESH)
    GUICtrlSetGraphic($g1, $GUI_GR_LINE, 1, 1)
    Return $g1
    EndFunc

    [/autoit]
  • Das schaut lsutig aus. ^^

    Muss es dann nurmehr für meine Zwecke umschreiben...

    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%

  • Wie gesagt, dass ist super recourcenlastig, wenn du nicht immer eine Gui löscht nachdem du eine erstellt hast... versuch mal mehr als ~250 Guis zu machen..das wird nach ner zeit hammer langsam ;)

  • Ich habs selber auch schon gemerkt...

    Wenn man doch nur die Größe der Ellipse ändern könnte. :/

    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%

  • Ich habs selber auch schon gemerkt...

    Wenn man doch nur die Größe der Ellipse ändern könnte. :/

    Kann man doch.

    Spoiler anzeigen
    [autoit]

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

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

    Global $Anzahl=50
    Global $Ellipse[$Anzahl]

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

    $Form1 = GUICreate("Test", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR ($WS_EX_TOPMOST, $WS_EX_LAYERED))
    GUISetBkColor ( 0x000000 )
    GUISetState()

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

    $Ellipse[0]=_DrawTransparentEllipse ( $Form1, @DesktopWidth/2-200, @DesktopHeight/2-200, 250, 200 )

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

    For $i=1 To $Anzahl-1 Step +1
    $Ellipse[$i]=_DrawTransparentEllipse ( $Form1, @DesktopWidth/2-200, @DesktopHeight/2-200, 250+$i, 200 )
    GUIDelete ( $Ellipse[$i-1] )
    Next

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

    While 1
    $msg=GUIGetMsg()
    Switch $msg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

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

    Func _DrawTransparentEllipse($hwnd, $x,$y,$w,$h,$Transparency=255)
    $Child=GUICreate ( "", $w, $h, $x, $y, $WS_CHILD, -1, $hwnd )
    _WinAPI_SetLayeredWindowAttributes($Form1, 0xABCDEF, $Transparency)
    GUISetBkColor ( 0xABCDEF, $Child )
    _GuiRoundCorners ( $Child, 0, 0, $w, $h)
    GUISetState()
    Return $Child
    EndFunc

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

    Func _DrawTransparentRect($hwnd, $x,$y,$w,$h,$Transparency=255)
    $Child=GUICreate ( "", $w, $h, $x, $y, $WS_CHILD, -1, $hwnd )
    _WinAPI_SetLayeredWindowAttributes($Form1, 0xABCDEF, $Transparency)
    GUISetBkColor ( 0xABCDEF, $Child )
    GUISetState()
    Return $Child
    EndFunc

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

    Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
    ; progandy
    If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
    If Not $isColorRef Then
    $i_transcolor = Hex(String($i_transcolor), 6)
    $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
    EndIf
    Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
    Select
    Case @error
    Return SetError(@error, 0, 0)
    Case $Ret[0] = 0
    Return SetError(4, _WinAPI_GetLastError(), 0)
    Case Else
    Return 1
    EndSelect
    EndFunc ;==>_WinAPI_SetLayeredWindowAttributes

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

    Func _WinAPI_GetLastError()
    Local $aResult

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

    $aResult = DllCall("Kernel32.dll", "int", "GetLastError")
    If @error Then Return SetError(@error, 0, 0)
    Return $aResult[0]
    EndFunc ;==>_WinAPI_GetLastError

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

    Func _GuiRoundCorners($hWnd, $x1, $y1, $x3, $y3)
    Local $pos, $ret, $ret2
    $pos = WinGetPos($hWnd)
    $ret = DllCall('gdi32.dll', 'long', 'CreateRoundRectRgn', 'long', $x1, 'long', $y1, 'long', $pos[2], 'long', $pos[3], 'long', $x3, 'long', $y3)
    If $ret[0] Then
    $ret2 = DllCall('user32.dll', 'long', 'SetWindowRgn', 'hwnd', $hWnd, 'long', $ret[0], 'int', 1)
    If $ret2[0] Then
    Return 1
    Else
    Return 0
    EndIf
    Else
    Return 0
    EndIf
    EndFunc

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

    Func _DrawTransparentLine($hwnd, $X,$Y,$length,$course,$pensize=2,$Transparency=255)
    _WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency)
    $g1=GUICtrlCreateGraphic($X,$Y,0,0)
    GUICtrlSetGraphic($g1, $GUI_GR_PENSIZE, $pensize )
    GUICtrlSetGraphic($g1, $GUI_GR_COLOR,0xABCDEF, 0xABCDEF)
    GUICtrlSetGraphic($g1, $GUI_GR_LINE, $length, $course)
    GUICtrlSetGraphic($g1, $GUI_GR_REFRESH)
    GUICtrlSetGraphic($g1, $GUI_GR_LINE, 1, 1)
    Return $g1
    EndFunc

    [/autoit]

    Aber die Funktion GuiDelete flimmer, wenn man sie auskommentiert und die Guis von AutoIt löschen lässt flimmert es kein bischen!

    AutoIt löscht die Guis irgendwie anders ;(