Ich mein, dass man nur eine zeichnet und die dann beliebig verkleiner oder vergrößern kann.
Und das flimmern kommt, weil beim löschen die dahinterliegende GUI ganz kurz sichtbar ist.
Ich mein, dass man nur eine zeichnet und die dann beliebig verkleiner oder vergrößern kann.
Und das flimmern kommt, weil beim löschen die dahinterliegende GUI ganz kurz sichtbar ist.
Ich mein, dass man nur eine zeichnet und die dann beliebig verkleiner oder vergrößern kann.
Und das flimmern kommt, weil dann die dahinterliegende GUI ganz kurz aufflimmert.
Ne verschieben kann man net, das kann mein bei GDI+ auch nicht, das flimmern muss aber von GuiDelet kommen weil dahinter noch ein durchsichtiges Gui ist, also wird der Hintergrund garnicht gezeigt...
Irgendwie muss das doch mit GUIDelete gehen
Wenn ihr zwischen dem guicreate der neuen eclipse und guidelete einen sleep von 20ms tut gehts ohne flimmern (zumindest bei mir), doch dann wirds wieder langsamer.. deswegen ist es auch nich so die perfekte lösung ;P aber langsam & wenig cpu-last ist immerhin schonmal besser als langsam & viel cpu - last..
Hm komisch bei mir ist es mit Sleep trotzdem nochda,
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $Anzahl=60
Global $Ellipse[$Anzahl]
$Form1 = GUICreate("Test", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR ($WS_EX_TOPMOST, $WS_EX_LAYERED))
GUISetBkColor ( 0x000000 )
GUISetState()
$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 )
Sleep ( 20 )
GUIDelete ( $Ellipse[$i-1] )
Next
While 1
$msg=GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
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
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
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
Func _WinAPI_GetLastError()
Local $aResult
$aResult = DllCall("Kernel32.dll", "int", "GetLastError")
If @error Then Return SetError(@error, 0, 0)
Return $aResult[0]
EndFunc ;==>_WinAPI_GetLastError
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
Ich frag gerade im Englischen Forum wie AutoIt die Guis löscht ohne zu flimmern, mal sehen was die schreiben.
Edit:
Hab die Lösung, einfach diesen Style noch dazu nehmen:
Global Const $WS_EX_COMPOSITED = 0x2000000
[/autoit][autoit][/autoit][autoit]$Form1 = GUICreate("Test", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR ($WS_EX_TOPMOST, $WS_EX_LAYERED,$WS_EX_COMPOSITED))
[/autoit]Edit2:
Meine UDF ist jetzt auch geupdated, schaut mal rein =)
Sehr schön!
Das is perfekt!
Danke für eure Hilfe!
So hab ichs angewendet:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <winapi.au3>
HotKeySet("{ESC}", "_Exit")
[/autoit] [autoit][/autoit] [autoit]Global $Anzahl = @DesktopWidth / 2
Global Const $WS_EX_COMPOSITED = 0x2000000
Global $Ellipse[$Anzahl]
$my_gui = GUICreate("MyGUI", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP,BitOR( $WS_EX_TOPMOST,$WS_EX_LAYERED, $WS_EX_COMPOSITED))
GUISetBkColor(0x000000)
GUISetState(@SW_SHOW)
_WinAPI_SetLayeredWindowAttributes($my_gui, 0xABCDEF, 255)
For $i = 1 To $Anzahl - 1 Step + 1
$Ellipse[$i] = _DrawTransparentEllipse ($my_gui, @DesktopWidth/16, @DesktopHeight/8 + $i / 2, @DesktopWidth/1.15, @DesktopHeight/1.30 - $i, 255)
Sleep (10)
If $Anzahl > 1 Then
GUIDelete ($Ellipse[$i-1])
EndIf
Next
While 1
Sleep (100)
WEnd
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
Func _Exit()
Exit
EndFunc
Func _DrawTransparentEllipse($hwnd, $x,$y,$w,$h,$Transparency=255)
$Child=GUICreate ( "", $w, $h, $x, $y, $WS_CHILD, -1, $hwnd )
_WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency)
GUISetBkColor ( 0xABCDEF, $Child )
_GuiRoundCorners ( $Child, 0, 0, $w, $h)
GUISetState()
Return $Child
EndFunc
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
PS: Greek Werde deine UDF weiterentfhelen.
PS: Greek Werde deine UDF weiterentfhelen.
hey, danke
Benutzt du das Script wenn du deinen PC runterfährst?^^
Achja:
Das hier brauchst du nicht, das wird schon in der Funktion gemacht.
_WinAPI_SetLayeredWindowAttributes($my_gui, 0xABCDEF, 255)
[/autoit]Hey erst einmal super UDF, Greek! =P
Aber ich weiß nicht ganz wie das geplant war, bei mir flickert das Script von H2112 immer noch wie wild :pinch:
Weiß nicht ob das an meinem Laptop oder am OS liegen kann (hab Vista )..
Hey erst einmal super UDF, Greek! =P
Aber ich weiß nicht ganz wie das geplant war, bei mir flickert das Script von H2112 immer noch wie wild :pinch:
Weiß nicht ob das an meinem Laptop oder am OS liegen kann (hab Vista )..
Bei mir flakert da uberhaupt nix mit dem neuen Style O.o
[autoit]Global Const $WS_EX_COMPOSITED = 0x2000000
[/autoit]Im Englischen Board hatte auch einer Probleme der Vista hatte...
aber weis nicht wie ich umschreiben soll, ich hab nirgends Vista zum ausprobieren
Unter Vista funtktioniert auch die Desktop Disco nicht richtig
Und nein ich benutz das nicht wenn ich runterfahr.
Danke für den Hinweis, habs sofort rausgenommen!
Ich hab da jetzt noch ein Problem mit den durchsichtigen Ellipsen. Ich hab jetzt ein sich öffnendes Auge gezeichnet, aber es flimmert.
Skript:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <winapi.au3>
HotKeySet("{ESC}", "_Exit")
[/autoit] [autoit][/autoit] [autoit]Global $Anzahl = @DesktopWidth / 2
Global Const $WS_EX_COMPOSITED = 0x2000000
Global $Ellipse[$Anzahl]
$my_gui = GUICreate("MyGUI", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP,BitOR( $WS_EX_TOPMOST,$WS_EX_LAYERED, $WS_EX_COMPOSITED))
GUISetBkColor(0x000000)
GUISetState(@SW_SHOW)
For $i = $Anzahl - 1 To 1 Step -1
$Ellipse[$i] = _DrawTransparentEllipse ($my_gui, @DesktopWidth/16, @DesktopHeight/8 + $i / 2, @DesktopWidth/1.15, @DesktopHeight/1.30 - $i, 255)
Sleep (5)
If $i > 1 Then
GUIDelete ($Ellipse[$i-1])
EndIf
Next
While 1
Sleep (100)
WEnd
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
Func _Exit()
Exit
EndFunc
Func _DrawTransparentEllipse($hwnd, $x, $y, $w, $h, $Transparency = 255)
$Child=GUICreate ("", $w, $h, $x, $y, $WS_CHILD, -1, $hwnd )
_WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency)
GUISetBkColor (0xABCDEF, $Child )
_GuiRoundCorners ($Child, 0, 0, $w, $h)
GUISetState()
Return $Child
EndFunc
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
Hätte wer eine Lösung gegen das flimmern?
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <winapi.au3>
HotKeySet("{ESC}", "_Exit")
[/autoit] [autoit][/autoit] [autoit]Global $Anzahl = @DesktopWidth / 2
Global Const $WS_EX_COMPOSITED = 0x2000000
Global $Ellipse[$Anzahl+1]
$my_gui = GUICreate("MyGUI", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP,BitOR( $WS_EX_TOPMOST,$WS_EX_LAYERED, $WS_EX_COMPOSITED))
GUISetBkColor(0x000000)
GUISetState(@SW_SHOW)
For $i = $Anzahl - 1 To 1 Step -1
$Ellipse[$i] = _DrawTransparentEllipse ($my_gui, @DesktopWidth/16, @DesktopHeight/8 + $i / 2, @DesktopWidth/1.15, @DesktopHeight/1.30 - $i, 255)
GUIDelete ($Ellipse[$i+1])
Next
While 1
Sleep (100)
WEnd
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
Func _Exit()
Exit
EndFunc
Func _DrawTransparentEllipse($hwnd, $x, $y, $w, $h, $Transparency = 255)
$Child=GUICreate ("", $w, $h, $x, $y, $WS_CHILD, -1, $hwnd )
_WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency)
GUISetBkColor (0xABCDEF, $Child )
_GuiRoundCorners ($Child, 0, 0, $w, $h)
GUISetState()
Return $Child
EndFunc
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
So klappts bei mir.