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

Beiträge von UEZ

  • Beep Songs :D

    • UEZ
    • 1. September 2010 um 15:58

    Wenn kein Systemlautsprecher installiert ist, dann schaut mal hier rein: DSBeep.au3 ;)

    Gruß,
    UEZ

  • Aus *.log datei einen verlauf erstellen mit GUI

    • UEZ
    • 1. September 2010 um 09:37

    Was bedeutet denn z.B. der Log Eintrag:

    "Aktion log vom 15.08.2010 um 16:06
    1 DoS auf User: Ron
    shutdown -a"

    Eine DoS Attacke? Wenn ja, dann solltest du hier keine Hilfe bekommen!

    Gruß,
    UEZ

  • GDI+ Zoomer

    • UEZ
    • 1. September 2010 um 09:04
    Zitat von andygo

    servus, sieht echt gut aus. ist das irgendwie nutzbar zu machen sagen wir das es z.b. auf audio reagiert? oder ist das nur n just4fun script?

    Der Fantasie sind keine Grenzen gesetzt! Natürlich kannst du das Skript dahin gehend verändern, so dass es auch auf Audio reagiert, z.B. anstelle der Kugeln ein Frequenzband.

    Ja, es ist ein Just4Fun Skript, was sonst? 8|

    Gruß,
    UEZ

  • Script wiederherstellen

    • UEZ
    • 31. August 2010 um 22:23

    Gegen das Dekompilieren wird es wohl nie einen richtigen Schutz geben...!

    Gruß,
    UEZ

  • GDI+ Zoomer

    • UEZ
    • 31. August 2010 um 21:31

    @all: danke für das Feedback!

    Bis zum nächsten GDI+ Script... ;)

    Gruß,
    UEZ

  • Update - Audio Visualizing

    • UEZ
    • 31. August 2010 um 19:38

    Sehr schön :thumbup:

    Aha, dafür hast du also das Spiegeln gebraucht... ;)


    Edit: Vista x86 ist der Hintergrund transparent!

    Gruß,
    UEZ

    PS: ich muss auch mal näher mit den Path Funktionen beschäftigen....

  • GDI+ Zoomer

    • UEZ
    • 31. August 2010 um 10:42

    Hier mal was wieder mit GDI+: Zoomer

    Spoiler anzeigen
    [autoit]


    ;Coded by UEZ 2010 Build 2010-08-31
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    #AutoIt3Wrapper_Run_After=del /f /q "Zoomer_Obfuscated.au3"
    #AutoIt3Wrapper_Run_After=upx.exe --ultra-brute "%out%"
    ;~ #AutoIt3Wrapper_Run_After=upx.exe --best "%out%"
    #include <GDIP.au3>
    #include <GUIConstantsEx.au3>

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

    Opt("MustDeclareVars", 1)
    Opt("GUIOnEventMode", 1)
    Opt("MouseCoordMode", 1)

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

    Local $hGUI, $hGraphics, $hBackbuffer, $hBitmap, $hBuffer, $hContext
    Local $W = 800, $H = $W
    Local $W2 = $W / 2, $H2 = $H / 2
    ; Initialize GDI+
    _GDIPlus_Startup()

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

    Local $GUI_title = "GDI+ Zoomer by UEZ 2010"
    $hGUI = GUICreate($GUI_title, $W, $H)
    GUISetBkColor(0x000000, $hGUI)
    GUISetState()

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

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($W, $H, $hGraphics)
    $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    ; Using antialiasing
    _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)

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

    ; Create a Brush object
    Local $hBrush = _GDIPlus_BrushCreateSolid()
    Local $hPen = _GDIPlus_PenCreate(0xA0000000, 2)

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

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

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

    Local $p = 40
    Local $k = 40
    Local $ps = $p / 10
    Local $t = 0
    Local $min = 8
    Local $mouse_sense = 5
    Local $i, $mpos, $fps, $cx, $cy, $pp

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

    $hBuffer = _GDIPlus_BitmapCreateFromScan0($W, $H)
    $hContext = _GDIPlus_ImageGetGraphicsContext($hBuffer)
    _GDIPlus_GraphicsTranslateTransform($hContext, -23, -23)
    _GDIPlus_GraphicsScaleTransform($hContext, 1.05, 1.05)
    _GDIPlus_GraphicsSetInterpolationMode($hContext, 0)

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

    MouseMove(@DesktopWidth / 2, @DesktopHeight / 2, 20)

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

    WinSetTitle($hGUI, "", $GUI_title & " / FPS: 0")

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

    AdlibRegister("FPS", 1000)
    Local $timer = TimerInit()
    While Sleep(20)
    _GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hBuffer, 0, 0, $W, $H)

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

    $mpos = MouseGetPos()
    If $mpos[0] / $mouse_sense > $min Then $p = $mpos[0] / $mouse_sense
    If $mpos[1] / $mouse_sense > $min Then $k = $mpos[1] / $mouse_sense

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

    For $i = 0 To 4
    _GDIPlus_BrushSetSolidColor($hBrush, "0x80FFFFFF")
    _GDIPlus_PenSetWidth($hPen, $ps)
    $pp = $p / 2
    $cx = $W2 - $pp + Sin($t / 15 + $i * 1.3) * $k
    $cy = $W2 - $pp + Cos($t / 23 - $i * 2.3) * $k
    _GDIPlus_GraphicsDrawEllipse($hBackbuffer, $cx , $cy, $p, $p, $hPen)
    _GDIPlus_GraphicsFillEllipse($hBackbuffer, $cx , $cy, $p, $p, $hBrush)
    Next
    $t += 3
    If TimerDiff($timer) > Random(5000, 15000, 1) Then
    _GDIPlus_GraphicsDrawString($hBackbuffer, "Coded by UEZ 2010", Random($W * 0.7, $W * 0.9, 1), Random($H * 0.33, $H * 0.66, 1), "Arial", 40, 1)
    $timer = TimerInit()
    EndIf

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

    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $W, $H)
    _GDIPlus_GraphicsDrawImageRect($hContext, $hBitmap, 0, 0, $W, $H)

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

    $fps += 1

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

    WEnd

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

    Func FPS()
    WinSetTitle($hGUI, "", $GUI_title & " / FPS: " & $fps)
    $fps = 0
    EndFunc

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

    Func _Exit()
    AdlibUnRegister("FPS")
    ; Clean up
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_BitmapDispose($hBuffer)
    _GDIPlus_GraphicsDispose($hContext)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_GraphicsDispose($hGraphics)

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

    ; Uninitialize GDI+
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
    Exit
    EndFunc

    [/autoit]

    Die GDIP.au3 wird dazu benötigt!

    Gruß,
    UEZ

    Dateien

    Zoomer.au3 3,27 kB – 702 Downloads
  • QuickDraw 100mal so schnell wie GDIPlus Update10 Texture speichern / Screencap

    • UEZ
    • 26. August 2010 um 22:24

    _QuickDraw_SetLineWidth() funzt nicht richtig (hard crash), wenn der Wert > 2 ist!

    Gruß,
    UEZ

  • InetGet über Cancel Button abbrechen

    • UEZ
    • 26. August 2010 um 21:53

    Hier ein Möglichkeit, die noch viel Erweiterungspotential hat!

    Spoiler anzeigen
    [autoit]


    ;Coded by UEZ 2010
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiStatusBar.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

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

    Opt("GUIOnEventMode", 1)
    Opt("MustDeclareVars", 1)

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

    Local $hGUI = GUICreate("Downloader by UEZ 2010", 615, 267, 192, 124)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    Local $Input_URL = GUICtrlCreateInput("http://www.autoitscript.com/autoit3/files/beta/autoit/autoit-v3.3.5.6-sfx.exe", 64, 24, 497, 21)
    Local $Label1 = GUICtrlCreateLabel("URL:", 32, 26, 29, 17)
    Local $Start_DL = GUICtrlCreateButton("Download", 64, 128, 75, 25)
    GUICtrlSetOnEvent(-1, "Start_DL")
    Local $Stop_DL = GUICtrlCreateButton("Cancel", 488, 128, 75, 25)
    GUICtrlSetOnEvent(-1, "Stop_DL")
    GUICtrlSetState(-1, $GUI_DISABLE)
    Local $Progress = GUICtrlCreateProgress(8, 192, 598, 17)
    Local $StatusBar = _GUICtrlStatusBar_Create($hGUI)
    _GUICtrlStatusBar_SetText($StatusBar, "Ready")
    Local $Input_Save_To = GUICtrlCreateInput(@ScriptDir, 64, 80, 497, 21)
    Local $Label2 = GUICtrlCreateLabel("Save to:", 16, 84, 44, 17)
    GUISetState(@SW_SHOW)

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

    Local $hDownload, $nBytes, $nRead, $nSize, $calc, $file, $url
    Local $prog = 0
    Local $stop = 0

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

    While Sleep(1000000000)
    WEnd

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

    Func Start_DL()
    $url = GUICtrlRead($Input_URL)
    $file = GUICtrlRead($Input_Save_To)
    If $url <> "" And $file <> "" Then
    GUICtrlSetState($Start_DL, $GUI_DISABLE)
    GUICtrlSetState($Stop_DL, $GUI_ENABLE)
    $file &= "\" & StringRight($url, StringLen($url) - StringInStr($url, "/", 0, -1))
    $nSize = InetGetSize($url)
    $hDownload = InetGet($url, $file, 1, 1)
    AdlibRegister("DL_Check", 50)
    EndIf
    EndFunc

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

    Func DL_Check()
    If InetGetInfo($hDownload, 2) Or $stop Then
    InetClose($hDownload)
    GUICtrlSetState($Start_DL, $GUI_ENABLE)
    GUICtrlSetState($Stop_DL, $GUI_DISABLE)
    GUICtrlSetData($Progress, 0)
    _GUICtrlStatusBar_SetText($StatusBar, "Ready")
    $stop = 0
    AdlibUnRegister("DL_Check")
    Else
    $nRead = InetGetInfo($hDownload, 0)
    $calc = Int(100 * $nRead / $nSize)
    GUICtrlSetData($Progress, $calc)
    _GUICtrlStatusBar_SetText($StatusBar, $nRead & " / " & $nSize & " bytes")
    EndIf
    EndFunc

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

    Func Stop_DL()
    $stop = 1
    EndFunc

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

    Func _Exit()
    InetClose($hDownload)
    GUIDelete($hGUI)
    Exit
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Tutorial AutoIt und Assembler UPDATE 24. Oktober 2010 Verwendung von Autoitvariablen im Assemblercode

    • UEZ
    • 24. August 2010 um 14:53
    Zitat von Andy

    Optimierung von Code am Beispiel des Tunnelfluges

    Wer das Beispiel im vorherigen Post durchgegangen ist, der hat wahrscheinlich den Kopf geschüttelt ob so viel Unfähigkeit des Programmierers^^
    Warum?
    Nun, wir (ich) haben ein AutoItScript nach Assembler portiert, aber dieses gemacht, OHNE NACHZUDENKEN!
    Allein das AutoItScript hat reichlich Kürzungs- und Optimierungsbedarf!
    Selbst mit geringen mathematischen Kenntnissen, kommt man auf folgendes Script:

    Spoiler anzeigen
    [autoit]

    ;Idea taken from http://js1k.com/demo/462
    ;Ported to AutoIt by UEZ Build 2010-08-20
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    #AutoIt3Wrapper_Run_After=del /f /q "Star Burst_Obfuscated.au3"
    #AutoIt3Wrapper_Run_After=upx.exe --ultra-brute "%out%"
    ;~ #AutoIt3Wrapper_Run_After=upx.exe --best "%out%"
    #include
    #include
    ;Opt("MustDeclareVars", 1)
    Opt("GUIOnEventMode", 1)

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

    Local $hGUI, $hGraphics, $hBackbuffer, $hBitmap
    Local $H = 332, $W = 332
    ; Initialize GDI+
    _GDIPlus_Startup()

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

    $hGUI = GUICreate("GDI+ Test", $W, $H)
    GUISetState()

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

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($W, $H, $hGraphics)
    $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)

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

    ; Using antialiasing
    ;~ _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 0)
    ; Create a Brush object
    Local $hBrush = _GDIPlus_BrushCreateSolid()

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

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

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

    adlibregister("_fps",1000)

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

    global $pi = ACos(-1), $pi2 = 2 * $pi, $pi05 = ACos(-1) * 0.5, $fps
    Local $HW = $H * 0.5, $HH = $W * 0.5
    Local $A0 = 0, $A1 = 0, $A2 = 0, $A3 = 0
    Local $ox = 0, $oy = 0, $0z = 0
    Local $tu = 0, $tv = 0
    Local $speed = 2
    Local $i, $j, $x, $y, $o
    Local $cc, $ss, $z, $col
    Local $dx, $dy, $dz, $rd, $A, $B, $C, $R, $t1, $tu, $tv, $q, $g, $l
    Local $d[$W + 1]

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

    $zwonulldrei=203.718330632686
    $nulldrei=0.390625
    ;$a1=0.07

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

    While 1;Sleep(10)
    _GDIPlus_GraphicsClear($hBackbuffer, 0xFF000000)

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

    For $i = 0 To $H Step $speed
    For $j = 0 To $W Step $speed
    $dx=($j/$W)-0.5;
    $dy=($i/$H)-0.5;
    $tu=int($zwonulldrei*ATan2($dy,$dx))
    $tv=($nulldrei/sqrt($dx*$dx+$dy*$dy))+$A1
    $tv=int($tv*256)
    $g = Hex(bitand(Bitxor($tu , $tv), 0xFF), 2)
    $col = "0xFF" & $g & $g & $g
    _GDIPlus_BrushSetSolidColor($hBrush, $col)
    _GDIPlus_GraphicsFillRect($hBackbuffer, $j, $i, $speed, $speed, $hBrush)

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

    Next
    Next
    $A1 += 0.07

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

    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $W, $H)
    $fps+=1
    ; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $A1 = ' & $A1 & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
    WEnd

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

    func _FPS()
    winsettitle($hgui,"",$FPS)
    $FPS=0
    endfunc

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

    Func Rotate($t)
    $cc = Cos($t)
    $ss = Sin($t)
    $z = $x * $cc - $y * $ss
    $y = $x * $ss + $y * $cc
    $x = $z
    EndFunc

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

    func atan2($y,$x)
    return (2*atan($y/($x+sqrt($x*$x+$y*$y))))
    endfunc

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

    Func ATan2_UEZ($y,$x)
    Switch $x
    Case ($x > 0)
    Return ATan($y / $x)
    Case ($x < 0 And $y >= 0)
    Return ATan($y / $x + $pi)
    Case ($x < 0 And $y < 0)
    Return ATan($y / $x - $pi)
    Case ($x = 0 And $y > 0)
    Return $pi05
    Case ($x = 0 And $y < 0)
    Return -$pi05
    Case ($x = 0 And $y = 0)
    Return 0
    EndSwitch
    EndFunc

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

    Func _Exit()
    ; Clean up
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_GraphicsDispose($hGraphics)

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

    ; Uninitialize GDI+
    _GDIPlus_Shutdown()
    Exit
    EndFunc

    [/autoit]

    Das sieht schon anders aus!
    Viele Variablen sind verschwunden und jede Menge Rechnerei auch!

    Alles anzeigen

    Dafür fehlt jetzt aber die Rotation ;)

    Gruß,
    UEZ

  • Selbst aktuellisierende Uhr

    • UEZ
    • 24. August 2010 um 00:03

    Hier eine recht simple Uhr in GDI+!

    Ich hoffe, dass du damit was anfangen kannst!

    [ offen ] Gdi plus

    Gruß,
    UEZ

  • Listview Registry

    • UEZ
    • 22. August 2010 um 14:07

    Probieres es mal damit:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Include <GuiListView.au3>
    #include <Array.au3>

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

    Opt('MustDeclareVars', 1)

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

    Example()

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

    Func Example()
    Local $listview, $button1, $button2, $item1, $item2, $item3, $input1, $msg
    Local $aSel, $dat1, $dat2, $dat3, $val1, $val2, $val3, $aWert

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

    GUICreate("listview items", 640, 250, 100, 200, -1)
    GUISetBkColor(0x00E0FFFF) ; will change background color

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

    $listview = GUICtrlCreateListView("Name |Pfad", 10, 10, 600, 150, -1, $LVS_REPORT + $LVS_EX_FULLROWSELECT);,$LVS_SORTDESCENDING)
    $button1 = GUICtrlCreateButton("Value?", 40, 170, 70, 20)
    $button2 = GUICtrlCreateButton("Delete", 110, 170, 70, 20)

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

    $val1 = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 1)
    $dat1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $val1)
    $val2 = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 2)
    $dat2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $val2)
    $val3 = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 3)
    $dat3 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $val3)

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

    $item1 = GUICtrlCreateListViewItem($val1 & "|" & $dat1, $listview)
    $item2 = GUICtrlCreateListViewItem($val2 & "|" & $dat2, $listview)
    $item3 = GUICtrlCreateListViewItem($val3 & "|" & $dat3, $listview)
    GUISetState()
    _GUICtrlListView_SetColumnWidth($listview, 0, 175)
    _GUICtrlListView_SetColumnWidth($listview, 1, 350)

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

    Do
    $msg = GUIGetMsg()

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

    Select
    Case $msg = $button1
    MsgBox(0, "listview item", GUICtrlRead(GUICtrlRead($listview)), 2)
    Case $msg = $listview
    MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2)
    Case $msg = $button2
    $aSel = _GUICtrlListView_GetSelectedIndices($listview, 1)
    If $aSel[0] > 0 Then
    $aWert = StringSplit(GUICtrlRead(GUICtrlRead($listview), 2), "|", 2)
    If Not @error Then
    ;~ _ArrayDisplay($aWert)
    ;RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $aWert[0])
    _GUICtrlListView_DeleteItem($listview, $aSel[1])
    EndIf
    EndIf
    EndSelect
    Until $msg = $GUI_EVENT_CLOSE
    EndFunc ;==>Example

    [/autoit]

    Habe es mit RegDelete nicht Live getestet, sollte aber so gehen!

    Schaue mal in CSV-Editor rein. Dort sind viele Techniken zu deinem Problem bereits implementiert!
    Gruß,
    UEZ

  • Sin, Cos & Tan Problem(e)

    • UEZ
    • 18. August 2010 um 19:50

    Du musst die Werte von Radiant nach Grad umwandeln -> http://de.wikipedia.org/wiki/Radiant_(Einheit) / http://de.wikipedia.org/wiki/Grad_(Winkel)

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

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

    $AuslesevariableCosinus = ""
    $AuslesevariableSinus = ""
    $AuslesevariableTangens = ""
    $deg = ACos(-1) / 180

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

    #Region ### START Koda GUI section ### Form=C:\Users\Tobias-Admin\Documents\Form1SinusCosinusTest.kxf
    $Form1SinusundCosinusTest = GUICreate("Sinus und Cosinus Test", 403, 214, -1, -1)
    $Input1Sinus = GUICtrlCreateInput("Zahl", 144, 16, 121, 21, $SS_CENTER)
    $Input2Cosinus = GUICtrlCreateInput("Zahl", 144, 64, 121, 21, $SS_CENTER)
    $Button1BerechnenSinusundCosinusTest = GUICtrlCreateButton("Berechnen", 24, 152, 107, 49)
    $Button2BeendenSinusundCosinusTest = GUICtrlCreateButton("Beenden", 272, 152, 107, 49)
    $Label1Sin = GUICtrlCreateLabel("Sin", 16, 16, 52, 17)
    $Label2gleich = GUICtrlCreateLabel("=", 88, 16, 36, 17)
    $Label3Cos = GUICtrlCreateLabel("Cos", 16, 64, 52, 17)
    $Label4gleich = GUICtrlCreateLabel("=", 88, 64, 36, 17)
    $Input3Tangens = GUICtrlCreateInput("Zahl", 144, 104, 121, 21, $SS_CENTER)
    $Label5Tan = GUICtrlCreateLabel("Tan", 16, 104, 36, 17)
    $Label6gleich = GUICtrlCreateLabel("=", 88, 104, 36, 17)
    GUISetState(@SW_SHOW, $Form1SinusundCosinusTest)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsgSinusundCosinusTest = GUIGetMsg()
    Switch $nMsgSinusundCosinusTest
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1BerechnenSinusundCosinusTest
    _FunktionTest ()
    Case $Button2BeendenSinusundCosinusTest
    Exit
    EndSwitch
    WEnd

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

    Func _FunktionTest ()
    $AuslesevariableSinus = GUICtrlRead($Input1Sinus)
    $AuslesevariableCosinus = GUICtrlRead($Input2Cosinus)
    $AuslesevariableTangens = GUICtrlRead($Input3Tangens)
    $cos = Cos($AuslesevariableCosinus * $deg)
    $sin = Sin($AuslesevariableSinus * $deg)
    $tan = Tan($AuslesevariableTangens * $deg)
    If $AuslesevariableSinus <> 0 And $AuslesevariableCosinus <> 0 And $AuslesevariableTangens <> 0 Then
    MsgBox(0, "Ergebnis Sinus, Cosinus und Tangens", "Sinus von "&$AuslesevariableSinus&" = "&$sin&@CR&"Cosinus von "&$AuslesevariableCosinus&" = "&$cos&@CR&"Tangens von "&$AuslesevariableTangens&" = "&$tan)
    ElseIf $AuslesevariableSinus <> 0 Then
    MsgBox(0, "Ergebnis Sinus", "Sinus von "&$AuslesevariableSinus&" = "&$sin)
    ElseIf $AuslesevariableCosinus <> 0 Then
    MsgBox(0, "Ergebnis Cosinus", "Cosinus von "&$AuslesevariableCosinus&" = "&$cos)
    ElseIf $AuslesevariableTangens <> 0 Then
    MsgBox(0, "Ergebnis Tangens", "Tangens von "&$AuslesevariableTangens&" = "&$tan)
    ElseIf $AuslesevariableSinus = 0 And $AuslesevariableCosinus = 0 And $AuslesevariableTangens = 0 Then
    MsgBox(0, "Ungültige Eingabe!", "Du hast nichts eingegeben.")
    EndIf
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • bilder komprimieren

    • UEZ
    • 18. August 2010 um 15:48

    Ich hatte mal dazu was geschrieben ;)

    Spoiler anzeigen
    [autoit]


    ;fast hack by UEZ
    #include <GuiConstantsEx.au3>
    #include <GDIPlus.au3>
    #include <ScreenCapture.au3>

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

    Opt('MustDeclareVars', 1)

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

    _Main()

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

    Func _Main()
    Local $hGUI1, $hGUI2, $hGUI3, $hImage, $hGraphic1, $hGraphic2, $hGraphic3, $sCLSID
    Local $bitmap1, $bitmap2, $bitmap3, $image1, $image2, $image3
    Local $tData, $tParams, $pParams, $pData

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

    ; Capture top left corner of the screen
    _ScreenCapture_Capture (@MyDocumentsDir & "\GDIPlus_Image.jpg", 0, 0, 400, 300)

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

    ; Create a GUI for the original image
    $hGUI1 = GUICreate("Original", 400, 300, 0, 0)
    GUISetState()

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

    ; Create a GUI for the scaled up image
    $hGUI2 = GUICreate("Scaled Up", 800, 600, 0, 350)
    GUISetState()

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

    ; Create a GUI for the scaled down image
    $hGUI3 = GUICreate("Scaled Down", 200, 150, 820, 400)
    GUISetState()

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

    ; Initialize GDI+ library and load image
    _GDIPlus_Startup ()
    $hImage = _GDIPlus_ImageLoadFromFile (@MyDocumentsDir & "\GDIPlus_Image.jpg")

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

    $sCLSID = _GDIPlus_EncodersGetCLSID ("JPG")

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

    ; Draw original image
    $hGraphic1 = _GDIPlus_GraphicsCreateFromHWND ($hGUI1)
    $bitmap1 = _GDIPlus_BitmapCreateFromGraphics(400, 300, $hGraphic1)
    $image1 = _GDIPlus_ImageGetGraphicsContext($bitmap1)
    _GDIPlus_GraphicsDrawImageRect($image1, $hImage, 0, 0, 400, 300)
    _GDIPlus_GraphicsDrawImageRect($hGraphic1, $bitmap1, 0, 0, 400, 300)
    _GDIPlus_ImageSaveToFileEx($bitmap1, @ScriptDir & "\GDIPlus_Image1.jpg", $sCLSID)
    _WinAPI_DeleteObject($bitmap1)
    _GDIPlus_GraphicsDispose($image1)

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

    ; Draw 2x scaled up image and save with lower jpg quality
    $hGraphic2 = _GDIPlus_GraphicsCreateFromHWND ($hGUI2)
    $bitmap2 = _GDIPlus_BitmapCreateFromGraphics(800, 600, $hGraphic2)
    $image2 = _GDIPlus_ImageGetGraphicsContext($bitmap2)
    _GDIPlus_GraphicsDrawImageRectRect ($image2, $hImage, 0, 0, 400, 300, 0, 0, 800, 600)
    _GDIPlus_GraphicsDrawImageRect($hGraphic2, $bitmap2, 0, 0, 800, 600)
    $tParams = _GDIPlus_ParamInit (1)
    $tData = DllStructCreate("int Quality")
    DllStructSetData($tData, "Quality", 10) ;quality 0-100
    $pData = DllStructGetPtr($tData)
    _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData)
    $pParams = DllStructGetPtr($tParams)
    _GDIPlus_ImageSaveToFileEx($bitmap2, @ScriptDir & "\GDIPlus_Image2.jpg", $sCLSID, $pParams)
    _WinAPI_DeleteObject($bitmap2)
    _GDIPlus_GraphicsDispose($image2)
    $tData = 0

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

    ; Draw 2x scaled down image
    $hGraphic3 = _GDIPlus_GraphicsCreateFromHWND ($hGUI3)
    $bitmap3 = _GDIPlus_BitmapCreateFromGraphics(200, 150, $hGraphic3)
    $image3 = _GDIPlus_ImageGetGraphicsContext($bitmap3)
    _GDIPlus_GraphicsDrawImageRectRect ($image3, $hImage, 0, 0, 400, 300, 0, 0, 200, 150)
    _GDIPlus_GraphicsDrawImageRect($hGraphic3, $bitmap3, 0, 0, 200, 150)
    _GDIPlus_ImageSaveToFileEx($bitmap3, @ScriptDir & "\GDIPlus_Image3.jpg", $sCLSID)
    _WinAPI_DeleteObject($bitmap3)
    _GDIPlus_GraphicsDispose($image3)

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

    ; Release resources
    _GDIPlus_GraphicsDispose ($hGraphic1)
    _GDIPlus_GraphicsDispose ($hGraphic2)
    _GDIPlus_GraphicsDispose ($hGraphic3)
    _GDIPlus_ImageDispose ($hImage)
    _GDIPlus_Shutdown ()

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

    ; Clean up screen shot file
    FileDelete(@MyDocumentsDir & "\GDIPlus_Image.jpg")

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

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

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

    Exit

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

    EndFunc ;==>_Main

    [/autoit]

    Schaue dir die Zeilen 52-58 genauer an :D

    Gruß,
    UEZ

    Dateien

    Image Scale and Save+.au3 3,37 kB – 297 Downloads
  • GDI+ Bild rotieren

    • UEZ
    • 17. August 2010 um 22:52

    Schau' mal hier nach: [ offen ] GDI - Png drehen und auf Hintergrund zeichen

    Gruß,
    UEZ

  • Gdi plus

    • UEZ
    • 16. August 2010 um 23:30

    Hier meine Version:

    Spoiler anzeigen
    [autoit]


    ;coded by UEZ 2011 build 2011-04-06
    ;~ #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_Obfuscated.au3"
    #AutoIt3Wrapper_UseUpx=y
    #AutoIt3Wrapper_UPX_Parameters=--brute --crp-ms=999999 --all-methods --all-filters
    ;~ #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

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

    #include <Date.au3>
    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    #Include <Timers.au3>
    #include <WindowsConstants.au3>

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

    Opt("MustDeclareVars", 1)
    Opt("GUIOnEventMode", 1)

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

    Global $hGUI, $hGraphics, $hBackbuffer, $hBitmap, $hPen1, $hPen2, $hPen3, $hPen4
    Global $iX = 600, $iY = $iX
    Global Const $p2_hm = $iX / 35
    Global Const $p3_hm = $iX / 35
    Global Const $p4_hm = $iX / 100
    Global $newY = $iX, $newX = $iY
    Global Const $minSize = $iX * 0.25
    Global Const $maxSize = $iX * 1.5
    Global Const $cX = $iX * 0.5, $cY = $iY * 0.5
    Global Const $deg = ACos(-1) / 180
    Global Const $radius = $iX * 0.85, $cR = $radius * 0.50
    Global Const $cR1 = $cR * 0.90, $cR2 = $cR * 0.20
    Global Const $cR3 = $cR * 0.80, $cR4 = $cR * 0.15
    Global Const $cR5 = $cR * 0.50, $cR6 = $cR * 0.10
    Global $sek = @SEC * 6 - 90
    Global $min = @MIN * 6 + (@SEC / 10) - 90
    Global $std = @HOUR * 30 + (@MIN / 2) - 90
    Global Const $fs = $iY / 30, $tms = $iY / 20, $tmh = $iY * 0.725
    Global $x1, $y1, $x2, $y2, $x3, $y3, $x4, $y4, $x5, $x6, $y5, $y6, $tm
    ; Initialize GDI+
    _GDIPlus_Startup()

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

    $hGUI = GUICreate("GDI+ Simple Clock by UEZ 2011", $iX, $iY, -1, -1, $WS_SIZEBOX)
    If @OSBuild < 7600 Then WinSetTrans($hGui,"", 0xFF) ;workaround for XP machines when alpha blending is activated on _GDIP
    GUISetState()

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

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iX, $iY, $hGraphics)
    $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)

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

    ; Using antialiasing
    _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)

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

    ; Create a Pen object
    $hPen1 = _GDIPlus_PenCreate(0xFF800010, 4)
    $hPen2 = _GDIPlus_PenCreate(0xA01010F0, $p2_hm)
    $hPen3 = _GDIPlus_PenCreate(0xA01010F0, $p3_hm)
    $hPen4 = _GDIPlus_PenCreate(0x9010D040, $p4_hm)

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

    Global Const $LineCapRound = 2, $LineCapTriangle = 3, $DashCapFlat = 0
    Global $hPath, $hCustomLineCap, $avCaps
    Global $avPoints[3][2] = [[2], [0, 0], [0, 0]]

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

    $hPath = _GDIPlus_PathCreate()
    _GDIPlus_PathAddLines($hPath, $avPoints)
    $hCustomLineCap = _GDIPlus_CustomLineCapCreate(0, $hPath)
    _GDIPlus_CustomLineCapSetStrokeCaps($hCustomLineCap, $LineCapTriangle, $LineCapRound)
    $avCaps = _GDIPlus_CustomLineCapGetStrokeCaps($hCustomLineCap)
    _GDIPlus_PenSetLineCap($hPen2, $avCaps[0], $avCaps[1], $DashCapFlat)
    _GDIPlus_PenSetLineCap($hPen3, $avCaps[0], $avCaps[1], $DashCapFlat)
    _GDIPlus_PenSetLineCap($hPen4, $avCaps[0], $avCaps[1], $DashCapFlat)

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

    Global $ws = WinGetPos($hGUI)
    Global $ratio = $ws[3] / $ws[2]
    Global $font = "Comic Sans MS"
    If FileExists(@WindowsDir & "\fonts\showg.ttf") Then $font = "Showcard Gothic"

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

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

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

    AdlibRegister("Ticker", 50)

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

    GUIRegisterMsg($WM_SIZE, "WM_SIZE")
    GUIRegisterMsg($WM_SIZING, "WM_SIZING")
    GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND")
    GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO")

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

    Global $timer = 100, $speak = False, $speak_init = True, $SpeakingClock = True
    Global $oVoice = ObjCreate("SAPI.SpVoice")
    If @error Then
    $speak_init = False
    Else
    $oVoice.Rate = -3
    EndIf

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

    GUIRegisterMsg($WM_TIMER, "Draw") ;$WM_TIMER = 0x0113
    DllCall("User32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $timer, "int", 0)

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

    AdlibRegister( "SpeakingClock", 1000)

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

    While Sleep(100000000)
    WEnd

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

    Func Draw()
    _GDIPlus_GraphicsClear($hBackbuffer, 0xF0FFFFFF)

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

    _GDIPlus_GraphicsDrawLine($hBackbuffer, $cX - $cR, $cY, $cX - $cR + 35, $cY, $hPen1)
    _GDIPlus_GraphicsDrawLine($hBackbuffer, $cX + $cR, $cY, $cX + $cR - 35, $cY, $hPen1)
    _GDIPlus_GraphicsDrawLine($hBackbuffer, $cX, $cY - $cR, $cX, $cY - $cR + 35, $hPen1)
    _GDIPlus_GraphicsDrawLine($hBackbuffer, $cX, $cY + $cR, $cX, $cY + $cR - 35, $hPen1)
    _GDIPlus_GraphicsDrawEllipse($hBackbuffer, $cX - $cR, $cY - $cR, $radius, $radius, $hPen1)

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

    For $i = 0 To 11
    _GDIPlus_GraphicsDrawString($hBackbuffer, $i + 1, -$fs / 2 + $cX + Cos(-45 + $i * 29.7 * $deg) * $cR3, -$fs * 0.9 + $cY + Sin(-45 + $i * 29.7 * $deg) * $cR3, $font, $fs)
    Next
    If Int(StringLeft(_NowTime(4), 2) / 12) Then
    $tm = "PM"
    Else
    $tm = "AM"
    EndIf
    _GDIPlus_GraphicsDrawString($hBackbuffer, $tm, -$tms * 1.1 + $cX, $tmh, $font, $tms)

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

    $x5 = $cX + Cos($std * $deg) * $cR5
    $y5 = $cY + Sin($std * $deg) * $cR5
    _GDIPlus_GraphicsDrawLine($hBackbuffer, $x5, $y5, $cX, $cY, $hPen2) ;hours

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

    $x3 = $cX + Cos($min * $deg) * $cR3
    $y3 = $cY + Sin($min * $deg) * $cR3
    _GDIPlus_GraphicsDrawLine($hBackbuffer, $x3, $y3, $cX, $cY, $hPen3) ;minutes

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

    $x1 = $cX + Cos($sek * $deg) * $cR1
    $y1 = $cY + Sin($sek * $deg) * $cR1
    $x2 = $cX + Cos(($sek + 180) * $deg) * $cR2
    $y2 = $cY + Sin(($sek + 180) * $deg) * $cR2
    _GDIPlus_GraphicsDrawLine($hBackbuffer, Floor($x1), Floor($y1), Floor($x2), Floor($y2), $hPen4) ;seconds

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

    _GDIPlus_GraphicsDrawEllipse($hBackbuffer, $cX - 3, $cY - 3, 6, 6, $hPen1)

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

    _GDIPlus_GraphicsDrawString($hBackbuffer, @HOUR & ":" & @MIN & ":" & @SEC, 0, 0)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iX, $iY)
    _WinAPI_RedrawWindow($hGUI)
    EndFunc

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

    Func SpeakingClock()
    If $min = -90.00 And $speak_init And $SpeakingClock Then $oVoice.Speak("It is " & Mod(@HOUR, 12) & " " & $tm, 1)
    EndFunc

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

    Func WM_ERASEBKGND($hWnd, $Msg, $wParam, $lParam)
    Local $hGraphicsTemp = _GDIPlus_GraphicsCreateFromHDC($wParam)
    _GDIPlus_GraphicsDrawImageRect($hGraphicsTemp, $hBitmap, 0, 0, $iX, $iY)
    _GDIPlus_GraphicsDispose($hGraphicsTemp)
    Return True
    EndFunc ;==>_WM_ERASEBKGND

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

    Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    $iX = BitAND($lParam, 0x0000FFFF)
    $iY = BitShift(BitAND($lParam, 0xFFFF0000), 16)
    ;~ ConsoleWrite("x: " & $iX & ", y: " & $iY & @CRLF)
    _WinAPI_RedrawWindow($hGUI)
    Return "GUI_RUNDEFMSG"
    EndFunc

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

    Func WM_SIZING($hWnd, $iMsg, $wParam, $lParam)
    Local $sRect = DllStructCreate("Int[4]", $lParam)
    Local $left = DllStructGetData($sRect, 1, 1)
    Local $top = DllStructGetData($sRect, 1, 2)
    Local $right = DllStructGetData($sRect, 1, 3)
    Local $bottom = DllStructGetData($sRect, 1, 4)

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

    Switch $wParam ;drag side or corner
    Case 1, 2, 4, 7
    $newY = ($right - $left) * $ratio
    DllStructSetData($sRect, 1, DllStructGetData($sRect, 1, 2) + $newY, 4)
    Case Else
    $newX = ($bottom - $top) / $ratio
    DllStructSetData($sRect, 1, DllStructGetData($sRect, 1, 1) + $newX, 3)
    EndSwitch
    Return "GUI_RUNDEFMSG"
    EndFunc ;==>WM_SIZING

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

    Func WM_GETMINMAXINFO($hWnd, $Msg, $wParam, $lParam)
    Local $minmaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam)
    DllStructSetData($minmaxinfo, 7, $minSize) ; min X
    DllStructSetData($minmaxinfo, 8, $minSize) ; min Y
    DllStructSetData($minmaxinfo, 9, $maxSize) ; max X
    DllStructSetData($minmaxinfo, 10, $maxSize) ; max Y
    Return "GUI_RUNDEFMSG"
    EndFunc ;==>WM_GETMINMAXINFO

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

    Func Ticker()
    $sek = @SEC * 6 - 90
    $min = @MIN * 6 + (@SEC * 0.10) - 90
    $std = @HOUR * 30 + (@MIN * 0.50) - 90
    EndFunc

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

    Func _Exit()
    AdlibUnRegister("Ticker")
    AdlibUnRegister("SpeakingClock")
    $oVoice = 0
    GUIRegisterMsg($WM_TIMER, "")
    GUIRegisterMsg($WM_GETMINMAXINFO, "")
    GUIRegisterMsg($WM_SIZE, "")
    GUIRegisterMsg($WM_ERASEBKGND, "")
    GUIRegisterMsg($WM_SIZING, "")

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

    ; Clean up GDI+ resources
    _GDIPlus_CustomLineCapDispose($hCustomLineCap)
    _GDIPlus_PathDispose($hPath)
    _GDIPlus_PenDispose($hPen1)
    _GDIPlus_PenDispose($hPen2)
    _GDIPlus_PenDispose($hPen3)
    _GDIPlus_PenDispose($hPen4)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_GraphicsDispose($hGraphics)

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

    ; Uninitialize GDI+
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
    Exit
    EndFunc

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

    Func _GDIPlus_PathCreate($iFillMode = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePath", "int", $iFillMode, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return $aResult[2]
    EndFunc ;==>_GDIPlus_PathCreate

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

    Func _GDIPlus_PathAddLines($hPath, $aPoints)
    Local $iI, $iCount, $pPoints, $tPoints, $aResult
    $iCount = $aPoints[0][0]
    $tPoints = DllStructCreate("float[" & $iCount * 2 & "]")
    $pPoints = DllStructGetPtr($tPoints)
    For $iI = 1 To $iCount
    DllStructSetData($tPoints, 1, $aPoints[$iI][0], (($iI - 1) * 2) + 1)
    DllStructSetData($tPoints, 1, $aPoints[$iI][1], (($iI - 1) * 2) + 2)
    Next
    $aResult = DllCall($ghGDIPDll, "uint", "GdipAddPathLine2", "hwnd", $hPath, "ptr", $pPoints, "int", $iCount)
    If @error Then Return SetError(@error, @extended, False)
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_PathAddLines

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

    Func _GDIPlus_PathDispose($hPath)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipDeletePath", "hwnd", $hPath)
    If @error Then Return SetError(@error, @extended, False)
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_PathDispose

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

    Func _GDIPlus_CustomLineCapCreate($hPathFill, $hPathStroke, $iLineCap = 0, $nBaseInset = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateCustomLineCap", "hwnd", $hPathFill, "hwnd", $hPathStroke, "int", $iLineCap, "float", $nBaseInset, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return $aResult[5]
    EndFunc ;==>_GDIPlus_CustomLineCapCreate

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

    Func _GDIPlus_CustomLineCapSetStrokeCaps($hCustomLineCap, $iStartCap, $iEndCap)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetCustomLineCapStrokeCaps", "hwnd", $hCustomLineCap, "int", $iStartCap, "int", $iEndCap)
    If @error Then Return SetError(@error, @extended, False)
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_CustomLineCapSetStrokeCaps

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

    Func _GDIPlus_CustomLineCapGetStrokeCaps($hCustomLineCap)
    Local $aCaps[2], $aResult
    $aResult = DllCall($ghGDIPDll, "uint", "GdipGetCustomLineCapStrokeCaps", "hwnd", $hCustomLineCap, "int*", 0, "int*", 0)
    If @error Then Return SetError(@error, @extended, -1)
    If $aResult[0] Then Return -1
    $aCaps[0] = $aResult[2]
    $aCaps[1] = $aResult[3]
    Return $aCaps
    EndFunc ;==>_GDIPlus_CustomLineCapGetStrokeCap

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

    Func _GDIPlus_PenSetLineCap($hPen, $iStartCap, $iEndCap, $iDashCap)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetPenLineCap197819", "hwnd", $hPen, "int", $iStartCap, "int", $iEndCap, "int", $iDashCap)
    If @error Then Return SetError(@error, @extended, False)
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_PenSetLineCap

    [/autoit]

    Gruß,
    UEZ

    Dateien

    Simple GDI+ Clock.au3 10,8 kB – 431 Downloads
  • _WinAPI_SetLayeredWindowAttributes

    • UEZ
    • 13. August 2010 um 17:04

    Hier was ähnliches als 1-Fenster Lösung:

    Spoiler anzeigen
    [autoit]


    #include <WindowsConstants.au3>
    #Include <WinAPIEx.au3>

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

    Opt('MustDeclareVars', 1)

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

    If Not _WinAPI_DwmIsCompositionEnabled() Then
    MsgBox(16, 'Error', 'Require Windows Vista or above with enabled Aero theme.')
    Exit
    EndIf

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

    Global $hForm, $hRgn, $hDC, $hPen, $obj_orig

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

    ; Create GUI
    $hForm = GUICreate('Transparent GUI', 200, 200, Default, Default,$WS_POPUP, $WS_EX_TOPMOST)

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

    GUISetBkColor(0)
    GUISetState()

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

    $hDC = _WinAPI_GetWindowDC($hForm) ; DC of entire screen (desktop)
    $hPen = _WinAPI_CreatePen($PS_SOLID, 5,0xFFFFFF)
    $obj_orig = _WinAPI_SelectObject($hDC, $hPen)
    _WinAPI_DrawLine($hDC, 5, 5, 5, 195)
    _WinAPI_DrawLine($hDC, 5, 5, 195, 5)
    _WinAPI_DrawLine($hDC, 195, 5, 195, 195)
    _WinAPI_DrawLine($hDC, 5, 195, 195, 195)

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

    ; Create the "sheet of glass" effect for the specified region. You must call this function whenever DWM composition is toggled.
    _WinAPI_DwmGetColorizationColor()
    If Not @extended Then
    $hRgn = _WinAPI_CreateRectRgn(5, 5, 195, 195)
    Else
    $hRgn = 0
    EndIf
    _WinAPI_DwmEnableBlurBehindWindow($hForm, 1, 0, $hRgn)
    If $hRgn Then
    _WinAPI_DeleteObject($hRgn)
    EndIf

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

    Do
    Until GUIGetMsg() = -3

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

    _WinAPI_SelectObject($hDC, $obj_orig)
    _WinAPI_DeleteObject($hPen)
    _WinAPI_ReleaseDC($hForm, $hDC)
    GUIDelete($hForm)
    Exit

    [/autoit]

    Benötigt wird die WinAPIEx.au3 und Vista+ und Aero!

    Gruß,
    UEZ

  • QuickDraw 100mal so schnell wie GDIPlus Update10 Texture speichern / Screencap

    • UEZ
    • 12. August 2010 um 23:55

    Hier mal 2 Beispiele erstellt mit QuickDraw:

    Tramp of Particles:
    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

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

    Als Vergleich auch die GDI+ und WinAPI Version ;)

    Danke an Andy für die WinAPI Version! :thumbup:

    Isometric Level-3 Cube:
    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Gruß,
    UEZ

    Bilder

    • Isometric Level-3 Cube.jpg
      • 7,65 kB
      • 260 × 209
    • Twister.png
      • 2,42 kB
      • 124 × 286

    Dateien

    Isometric Level-3 Cube.au3 3,86 kB – 442 Downloads GDI+ Isometric Level-3 Cube.au3 5,08 kB – 435 Downloads Tramp of Particles.png 6,69 kB – 0 Downloads Tramp of Particles.au3 2,71 kB – 455 Downloads GDI+ Tramp of Particles.au3 4,74 kB – 396 Downloads Tramp of Particles WinAPI.au3 5,17 kB – 405 Downloads Twister GDI+.au3 4,37 kB – 419 Downloads Twister WinAPI.au3 5,05 kB – 378 Downloads Twister.au3 3,08 kB – 412 Downloads
  • _WinAPI_SetLayeredWindowAttributes

    • UEZ
    • 11. August 2010 um 16:27

    Hier eine Version:

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <WinApi.au3>
    #include <GDIPlus.au3>

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

    #Region ### START Koda GUI section ### Form=
    $width = 200
    $height = 200
    $hwnd = GUICreate("Form1", $width, $height, Default, Default, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST)
    GUISetState(@SW_SHOW)
    $bsize_x = 50
    $bsize_y = 30
    $child = GUICreate("", $bsize_x, $bsize_y, $width * 0.5 - $bsize_x * 0.5, $height * 0.5 - $bsize_y * 0.5, $WS_POPUP, $WS_EX_MDICHILD + $WS_EX_LAYERED, $hwnd)
    $button = GUICtrlCreateButton ("Test", 0, 0, $bsize_x, $bsize_y)
    _WinAPI_SetLayeredWindowAttributes($child, 0xFFFFFF, 160)
    GUISetState(@SW_SHOW)

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

    ;~ GUISetBkColor (0xFFFFFF)
    #EndRegion ### END Koda GUI section ###

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

    _GDIPlus_Startup ()
    $Graphics = _GDIPlus_GraphicsCreateFromHWND ($hwnd)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics)
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)

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

    $ScreenDc = _WinAPI_GetDC($hWnd)
    $gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($bitmap)
    $dc = _WinAPI_CreateCompatibleDC($ScreenDc)
    _WinAPI_SelectObject($dc, $gdibitmap)
    ; _WinAPI_UpdateLayeredWindow parameters
    $tSize = DllStructCreate($tagSIZE)
    $pSize = DllStructGetPtr($tSize)
    DllStructSetData($tSize, "X", $width)
    DllStructSetData($tSize, "Y", $height)
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    $alpha = 160
    DllStructSetData($tBlend, "Alpha", $alpha)
    DllStructSetData($tBlend, "Format", 0)
    $tPoint = DllStructCreate($tagPOINT)
    $pPoint = DllStructGetPtr($tPoint)
    DllStructSetData($tPoint, "X", 0)
    DllStructSetData($tPoint, "Y", 0)

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

    $PenRect = _GDIPlus_PenCreate (0xFFFFAA00, 10)
    _GDIPlus_GraphicsClear($backbuffer, 0xFFFFFFFF)
    _GDIPlus_GraphicsDrawRect($backbuffer, 0, 0, $width, $height, $PenRect)
    $gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($bitmap)
    _WinAPI_SelectObject($dc, $gdibitmap)
    _WinAPI_UpdateLayeredWindow($hWnd, $ScreenDc, 0, $pSize, $dc, $pSource, 0, $pBlend, 2)
    _WinAPI_DeleteObject($gdibitmap)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case -3
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_BitmapDispose($bitmap)
    _WinAPI_DeleteDC($dc)
    _WinAPI_ReleaseDC($hWnd, $ScreenDc)
    _GDIPlus_GraphicsDispose($Graphics)
    _GDIPlus_Shutdown()
    $tSize = ""
    $tSource = ""
    $tBlend = ""
    $tPoint = ""
    GUIDelete($child)
    GUIDelete($hwnd)
    Exit
    Case $button
    WinSetOnTop($hwnd, "", False)
    MsgBox(0, "Transparenz", "von UEZ '2010")
    WinSetOnTop($hwnd, "", True)
    EndSwitch
    WEnd

    [/autoit]

    Gruß,
    UEZ

  • Tutorial AutoIt und Assembler UPDATE 24. Oktober 2010 Verwendung von Autoitvariablen im Assemblercode

    • UEZ
    • 9. August 2010 um 22:21

    Well done ANDY 8o :thumbup: :thumbup: :thumbup: :thumbup:

    Vielen Dank für das ausführliche Tutorial :!: :!: :!:

    Gruß,
    UEZ

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™