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

  • AutoIt Windows Screenshooter v1.87 Build 2026-09-01

    • UEZ
    • 12. September 2011 um 21:54

    Tweaky: sollte jetzt "gefixt" sein: ich musste die GUI auf maximal 8192x8192 festlegen, da sonst die GUI weiß bleibt.

    Gruß,
    UEZ

  • AutoIt Windows Screenshooter v1.87 Build 2026-09-01

    • UEZ
    • 12. September 2011 um 20:41
    Zitat von Tweaky

    Wenn ich diese komplette Webseite abfotografieren will kommt nur eine leere weiße Seite.
    Kannst ja mal schauen, was da nicht stimmt.
    Getestet mit der Version vom 09.09.2011

    Die Seite hat eine riesen Auflösung -> 12916x7744, aber ich muss mal debuggen, warum die Seite so angezeigt wird!

    Zitat von Fabi

    Dein Script ist cool aber ist die "F12 Taste" nicht für Windows schon fest registriert?

    F12 ist nur dann aktiv, wenn das Fenster aktiv ist, d.h. F12 funktioniert außerhalb wie gewohnt.


    DANKE für euer Feedback. :thumbup:

    Gruß,
    UEZ

  • GDI+ Bild (komplett) Transparent machen

    • UEZ
    • 11. September 2011 um 15:23

    Hier noch eine Möglichkeit: http://www.autoitscript.com/forum/topic/13…post__p__916507

    Gruß,
    UEZ

  • Ich bin dumm

    • UEZ
    • 8. September 2011 um 17:42
    Zitat von meyermeyer11


    Ich bin dumm

    Wohnort: Ostfriesland

    Hmmm, das ist kein Witz oder? :huh:

    Gruß,
    UEZ

  • AVIMakeCompressedStream aktivieren

    • UEZ
    • 7. September 2011 um 21:06

    @TheShadowAE: ich habe "Grab to Avi" für meinen Screenshooter implementiert, aber die Avi Datei wird umkomprimiert erstellt, und somit wird sie ziemlich groß.

    Den C++ verstehe ich leider nicht richtig...

    Kannst mir ja helfen ihn richtig zu übersetzen.

    Gruß,
    UEZ

  • AVIMakeCompressedStream aktivieren

    • UEZ
    • 7. September 2011 um 20:48

    Genau da liegt das Problem: ich weiß nicht, was ich falsch gemacht habe, denn der Rückgabewert ist 0x80040154. Wenn die Funktion richtig aufgerufen wird, sollter der Rückgabewert 0 sein.

    Gruß,
    UEZ

  • AVIMakeCompressedStream aktivieren

    • UEZ
    • 7. September 2011 um 20:26

    Bist du dir da sicher?

    Denn $aRet[1] = 0x000000...

    Wenn ich $psCompressed = $aRet[1] setze, dann stürzt das Skript ab.

    Gruß,
    UEZ

  • AVIMakeCompressedStream aktivieren

    • UEZ
    • 7. September 2011 um 14:54

    Hi,

    weiß jemand, wie ich die AVIMakeCompressedStream aus Avifil32.dll aktivieren kann?

    Ich kann die AVIWriter.au3 benutzen, um z.B. eine AVI Datei mit Screenshots vom Desktop zu erstellen. Aber das Problem ist, dass die AVI Datei relativ groß wird.
    Nun gibt es die Funktion AVIMakeCompressedStream aus Avifil32.dll, um diesen Stream zu komprimieren, aber irgendwie kriege ich es nicht gebacken.

    Hier die modifizierte AVIWriter.au3 mit einem Beispiel, um 1 Sekunde vom aktiven Fenster aufzunehmen:

    Spoiler anzeigen
    [autoit]


    #AutoIt3Wrapper_UseX64=n
    #include <WinAPI.au3>

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

    #region AVIWriter UDF
    ;Global Const $mmioFOURCC_M_S_V_C = _Create_mmioFOURCC("MSVC") ;1129730893
    Global Const $BITMAPFILEHEADER = "align 2;char magic[2];int size;short res1;short res2;ptr offset;"
    Global Const $BITMAPINFOHEADER = "dword biSize;long biWidth;long biHeight;short biPlanes;short biBitCount;" & _
    "dword biCompression;dword biSizeImage;long biXPelsPerMeter;long biYPelsPerMeter;dword biClrUsed;dword biClrImportant;"
    Global Const $OF_CREATE = 0x00001000
    Global Const $AVIIF_KEYFRAME = 0x00000010
    Global Const $ICMF_CHOOSE_KEYFRAME = 1, $ICMF_CHOOSE_DATARATE = 2
    Global Const $AVIERR_UNSUPPORTED = 0x80044065
    Global Const $AVIERR_MEMORY = 0x80044067
    Global Const $AVIERR_NOCOMPRESSOR = 0x80044071
    Global Const $AVIERR_CANTCOMPRESS = 0x80044075
    Global Const $AVIERR_ERROR = 0x800440C7
    Global Const $AVIERR_OK = 0
    Global $Avi32_Dll

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

    ;http://msdn.microsoft.com/en-us/library/ms899423.aspx
    Global Const $AVISTREAMINFO = "dword fccType;dword fccHandler;dword dwFlags;dword dwCaps;short wPriority;short wLanguage;dword dwScale;" & _
    "dword dwRate;dword dwStart;dword dwLength;dword dwInitialFrames;dword dwSuggestedBufferSize;dword dwQuality;" & _
    "dword dwSampleSize;int rleft;int rtop;int rright;int rbottom;dword dwEditCount;dword dwFormatChangeCount;wchar[64];"

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

    ;http://msdn.microsoft.com/en-us/library/…1(v=VS.85).aspx
    Global Const $AVICOMPRESSOPTIONS = "DWORD fccType;DWORD fccHandler;DWORD dwKeyFrameEvery;DWORD dwQuality;DWORD dwBytesPerSecond;" & _
    "DWORD dwFlags;PTR lpFormat;DWORD cbFormat;PTR lpParms;DWORD cbParms;DWORD dwInterleaveEvery;"

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

    Func _Create_mmioFOURCC($FOURCC) ;http://www.fourcc.org/codecs.php
    If StringLen($FOURCC) <> 4 Then Return SetError(1, 0, 0)
    Local $aFOURCC = StringSplit($FOURCC, "", 2)
    Return BitOR(Asc($aFOURCC[0]), BitShift(Asc($aFOURCC[1]), -8), BitShift(Asc($aFOURCC[2]), -16), BitShift(Asc($aFOURCC[3]), -24))
    EndFunc ;==>_Create_mmioFOURCC

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

    Func _DecodeFOURCC($iFOURCC)
    If Not IsInt($iFOURCC) Then Return SetError(1, 0, 0)
    Return Chr(BitAND($iFOURCC, 0xFF)) & Chr(BitShift(BitAND(0x0000FF00, $iFOURCC), 8)) & Chr(BitShift(BitAND(0x00FF0000, $iFOURCC), 16)) & Chr(BitShift($iFOURCC, 24))
    EndFunc ;==>_DecodeFOURCC

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

    ; monoceres, Prog@ndy
    Func _CreateAvi($sFilename, $FrameRate, $Width, $Height, $BitCount = 24, $mmioFOURCC = "MSVC")
    Local $RetArr[5] ; avi file handle, stream handle, bitmap count, BitmapInfoheader, Stride

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

    Local $aRet, $pfile, $asi, $aco, $pstream, $psCompressed

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

    $aRet = DllCall($Avi32_Dll, "int", "AVIFileOpenW", "ptr*", 0, "wstr", $sFilename, "uint", $OF_CREATE, "ptr", 0)
    $pfile = $aRet[1]

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

    Local $stride = BitAND(($Width * ($BitCount / 8) + 3), BitNOT(3))

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

    Local $bi = DllStructCreate($BITMAPINFOHEADER)
    DllStructSetData($bi, "biSize", DllStructGetSize($bi))
    DllStructSetData($bi, "biWidth", $Width)
    DllStructSetData($bi, "biHeight", $Height)
    DllStructSetData($bi, "biPlanes", 1)
    DllStructSetData($bi, "biBitCount", $BitCount)
    DllStructSetData($bi, "biSizeImage", $stride * $Height)

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

    $asi = DllStructCreate($AVISTREAMINFO)
    DllStructSetData($asi, "fccType", _Create_mmioFOURCC("vids"))
    DllStructSetData($asi, "fccHandler", _Create_mmioFOURCC($mmioFOURCC))
    DllStructSetData($asi, "dwScale", 1)
    DllStructSetData($asi, "dwRate", $FrameRate)
    ;~ DllStructSetData($asi, "dwQuality", $Quality) ;Quality is represented as a number between 0 and 10,000. For compressed data, this typically represents the value of the quality parameter passed to the compression software. If set to –1, drivers use the default quality value.
    DllStructSetData($asi, "rright", $Width)
    DllStructSetData($asi, "rbottom", $Height)
    ;~ DllStructSetData($asi, "dwSuggestedBufferSize", $stride * $Height)

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

    $aco = DllStructCreate($AVICOMPRESSOPTIONS)
    $aRet = DllCall($Avi32_Dll, "int", "AVIFileCreateStream", "ptr", $pfile, "ptr*", 0, "ptr", DllStructGetPtr($asi))
    $pstream = $aRet[2]

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

    ConsoleWrite(DllStructGetData($AVICOMPRESSOPTIONS, "fccHandler") & @CRLF)

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

    Local $hWnd= GUICreate("")
    $aRet = DllCall($Avi32_Dll, "int_ptr", "AVISaveOptions", "hwnd", $hWnd, "uint", BitOR($ICMF_CHOOSE_DATARATE, $ICMF_CHOOSE_KEYFRAME), "int", 1, "ptr*", $pstream, "ptr*", DllStructGetPtr($aco))
    GUIDelete($hWnd)
    If $aRet[0] <> 1 Then
    $RetArr[0] = $pfile
    $RetArr[1] = $pstream
    Return SetError(1, 0, $RetArr)
    EndIf

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

    ConsoleWrite(_DecodeFOURCC(DllStructGetData($aco, "fccHandler")) & @CRLF)

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

    $aRet = DllCall($Avi32_Dll, "int", "AVIMakeCompressedStream", "ptr*", 0, "ptr", $pstream, "ptr", DllStructGetPtr($aco), "ptr*", 0)
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $aRet = ' & Hex($aRet[0]) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
    $psCompressed = $aRet[2]

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

    ; The format for the stream is the same as BITMAPINFOHEADER
    $aRet = DllCall($Avi32_Dll, "int", "AVIStreamSetFormat", "ptr", $psCompressed, "long", 0, "ptr", DllStructGetPtr($bi), "long", DllStructGetSize($bi))

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

    $RetArr[0] = $pfile
    $RetArr[1] = $psCompressed
    $RetArr[2] = 0
    $RetArr[3] = $bi
    $RetArr[4] = $stride
    Return $RetArr
    EndFunc ;==>_CreateAvi

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

    ; Adds a bitmap file to an already opened avi file.
    ; monoceres, Prog@ndy
    Func _AddHBitmapToAvi(ByRef $Avi_Handle, $hBitmap)
    Local $DC = _WinAPI_GetDC(0)
    Local $hDC = _WinAPI_CreateCompatibleDC($DC)
    _WinAPI_ReleaseDC(0, $DC)

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

    Local $OldBMP = _WinAPI_SelectObject($hDC, $hBitmap)
    Local $bits = DllStructCreate("byte[" & DllStructGetData($Avi_Handle[3], "biSizeImage") & "]")
    _WinAPI_GetDIBits($hDC, $hBitmap, 0, Abs(DllStructGetData($Avi_Handle[3], "biHeight")), DllStructGetPtr($bits), DllStructGetPtr($Avi_Handle[3]), 0)
    _WinAPI_SelectObject($hDC, $OldBMP)
    _WinAPI_DeleteDC($hDC)

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

    DllCall($Avi32_Dll, "int", "AVIStreamWrite", "ptr", $Avi_Handle[1], "long", $Avi_Handle[2], "long", 1, "ptr", DllStructGetPtr($bits), _
    "long", DllStructGetSize($bits), "long", $AVIIF_KEYFRAME, "ptr*", 0, "ptr*", 0)
    $Avi_Handle[2] += 1
    EndFunc ;==>_AddHBitmapToAvi

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

    ; Adds a bitmap file to an already opened avi file.
    Func _AddBitmapToAvi(ByRef $Avi_Handle, $sBitmap)
    Local $bm = LoadBitmap($sBitmap, True)
    DllCall($Avi32_Dll, "int", "AVIStreamWrite", "ptr", $Avi_Handle[1], "long", $Avi_Handle[2], "long", 1, "ptr", DllStructGetPtr($bm[2]), _
    "long", DllStructGetSize($bm[2]), "long", $AVIIF_KEYFRAME, "ptr*", 0, "ptr*", 0)
    $Avi_Handle[2] += 1
    EndFunc ;==>_AddBitmapToAvi

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

    ; Returns array with 3 elements
    ; [0]=BITMAPFILEHEADER
    ; [1]=BITMAPINFOHEADER
    ; [2]=Bitmap data buffer (if specified)
    Func LoadBitmap($sFilename, $LoadData = False)
    Local $RetArr[3]
    Local $byref
    Local $bih, $bfh, $buffer, $fhandle
    $bfh = DllStructCreate($BITMAPFILEHEADER)
    $bih = DllStructCreate($BITMAPINFOHEADER)
    $fhandle = _WinAPI_CreateFile($sFilename, 2, 2, 0, 0)
    _WinAPI_ReadFile($fhandle, DllStructGetPtr($bfh), DllStructGetSize($bfh), $byref)
    _WinAPI_ReadFile($fhandle, DllStructGetPtr($bih), DllStructGetSize($bih), $byref)
    $RetArr[0] = $bfh
    $RetArr[1] = $bih

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

    If Not $LoadData Then
    _WinAPI_CloseHandle($fhandle)
    Return $RetArr
    EndIf

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

    $buffer = DllStructCreate("byte[" & DllStructGetData($bfh, "size") - 54 & "]")
    $RetArr[2] = $buffer
    _WinAPI_ReadFile($fhandle, DllStructGetPtr($buffer), DllStructGetSize($buffer), $byref)
    _WinAPI_CloseHandle($fhandle)

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

    Return $RetArr
    EndFunc ;==>LoadBitmap

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

    ; Init the avi library
    Func _StartAviLibrary()
    $Avi32_Dll = DllOpen("Avifil32.dll")
    DllCall($Avi32_Dll, "none", "AVIFileInit")
    ;~ MsgBox(0,"",@error)
    EndFunc ;==>_StartAviLibrary

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

    ; Release the library
    Func _StopAviLibrary()
    DllCall($Avi32_Dll, "none", "AVIFileExit")
    DllClose($Avi32_Dll)
    EndFunc ;==>_StopAviLibrary

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

    Func _CloseAvi($Avi_Handle)
    DllCall($Avi32_Dll, "int", "AVIStreamRelease", "ptr", $Avi_Handle[1])
    DllCall($Avi32_Dll, "int", "AVIFileRelease", "ptr", $Avi_Handle[0])
    EndFunc ;==>_CloseAvi
    #endregion

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

    #region example
    #include <Array.au3>
    #include <Memory.au3>
    #include <ScreenCapture.au3>

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

    _GDIPlus_Startup()
    HotKeySet("{ESC}", "close")

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

    Break(0)

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

    FileDelete(@ScriptDir & "\test.avi")

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

    $tPoint = DllStructCreate($tagPOINT)
    $aMPos = MouseGetPos()
    DllStructSetData($tPoint, 1, $aMPos[0])
    DllStructSetData($tPoint, 2, $aMPos[1])
    $hWin = _WinAPI_WindowFromPoint($tPoint)
    $hWinAncestor = _WinAPI_GetAncestor($hWin, 2)
    $hWnd = HWnd($hWinAncestor)
    $aPos = WinGetPos($hWnd)

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

    $rec_duration = 1000 * 1

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

    ConsoleWrite("Starting...." & @CRLF)

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

    _StartAviLibrary()
    $aAVI = _CreateAvi(@ScriptDir & "\test.avi", 15, $aPos[2], $aPos[3])
    If @error Then close()

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

    $t = TimerInit()

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

    Do
    $hBmp = _ScreenCapture_CaptureWnd("", $hWnd)
    $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp)
    _AddHBitmapToAvi($aAVI, $hBmp)
    _WinAPI_DeleteObject($hBmp)
    If TimerDiff($t) > $rec_duration Then close()
    Until False

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

    Func close()
    _GDIPlus_Shutdown()
    _CloseAvi($aAVI)
    _StopAviLibrary()
    Exit
    EndFunc ;==>close
    #endregion

    [/autoit]

    Es gibt unmengen an Quellen, aber irgendwie bekomme ich das in AutoIt nicht hin, z.B. BMPs to Avi.

    Hat jemand noch eine Idee?

    Gruß,
    UEZ

  • _GuiCtrlSetFont

    • UEZ
    • 6. September 2011 um 15:29

    Sieht cool aus!

    sumsum: hast du mal das Skript gestartet?

    Gruß,
    UEZ

  • AutoIt Windows Screenshooter v1.87 Build 2026-09-01

    • UEZ
    • 6. September 2011 um 11:45

    Noch'n Update: jetzt mit Video Aufzeichnungsfunktion (AVI noch unkomprimiert) + Lineal Funktion zum Messen von Distanzen.

    Gruß,
    UEZ

  • AutoIt Windows Screenshooter v1.87 Build 2026-09-01

    • UEZ
    • 6. September 2011 um 11:45

    Noch'n Update: jetzt mit Video Aufzeichnungsfunktion (AVI noch unkomprimiert) + Lineal Funktion zum Messen von Distanzen.

    Gruß,
    UEZ

  • If Then Else: mehrzeilige Anweisung

    • UEZ
    • 30. August 2011 um 10:18

    Wenn dann eher so:

    [autoit]


    If $instr = $inval1 Then
    GUICtrlSetBkColor($inv1, 0x00a800)
    Run($pro1)
    EndIf

    [/autoit]

    Was soll der Text am Ende sein?

    Gruß,
    UEZ

  • ISO Creator v1.16 build 2012-09-11 beta

    • UEZ
    • 29. August 2011 um 14:40

    Hast recht, kommt wohl aus dem Englischen -> EXEs...

    Apropos Exen, die muss ich noch hochladen...

    Danke,
    UEZ

  • ISO Creator v1.16 build 2012-09-11 beta

    • UEZ
    • 29. August 2011 um 14:11

    Kleines Update!

    Gruß,
    UEZ

  • Buttons im GUIOnEvent-Mode ansprechen

    • UEZ
    • 27. August 2011 um 18:28

    Für den GUIOnEvent-Mode benötigst du Funktionen, die von den Buttons angesprochen werden, wenn sie betätigt werden.

    Beispiel:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>

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

    Opt("GUIOnEventMode", 1)

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

    Dim $buttons[11]

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

    GUICreate("Test", 100, 400)

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

    For $i = 1 To 10
    $buttons[$i] = GUICtrlCreateButton("Button " & $i, 10, 10 + $i * 30)
    GUICtrlSetOnEvent($buttons[$i], "B" & $i)
    Next

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

    GUISetState()

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

    GUISetOnEvent($GUI_EVENT_CLOSE, "_beenden")

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

    While 1
    Sleep(10)
    WEnd

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

    Func B1()
    MsgBox(0, "Test", "Button1")
    EndFunc

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

    Func B2()
    MsgBox(0, "Test", "Button2")
    EndFunc

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

    Func B3()
    MsgBox(0, "Test", "Button3")
    EndFunc

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

    Func B4()
    MsgBox(0, "Test", "Button4")
    EndFunc

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

    Func B5()
    MsgBox(0, "Test", "Button5")
    EndFunc

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

    Func B6()
    MsgBox(0, "Test", "Button6")
    EndFunc

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

    Func B7()
    MsgBox(0, "Test", "Button7")
    EndFunc

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

    Func B8()
    MsgBox(0, "Test", "Button8")
    EndFunc

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

    Func B9()
    MsgBox(0, "Test", "Button9")
    EndFunc

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

    Func B10()
    MsgBox(0, "Test", "Button10")
    EndFunc

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

    Func _beenden()
    Exit
    EndFunc ;==>_beenden

    [/autoit]

    Dies war meine erste Idee, vielleicht gibt es elegantere Lösungen!

    Gruß,
    UEZ

  • Screenshot erstellen

    • UEZ
    • 23. August 2011 um 19:05

    andygo: das ist nicht das gleiche Freihandmarkieren! ;)

    Gruß,
    UEZ

  • Screenshot erstellen

    • UEZ
    • 22. August 2011 um 11:27

    Schaue mal hier rein: AutoIt Windows Screenshooter v1.29 Build 2011-08-16 Final

    Ich benutze keinerlei DLLs!

    Wenn ich Zeit finde, werde ich noch das Freihand Markieren des Desktop Bereiches implementieren.

    Gruß,
    UEZ

  • ColorConstantsEx - 400 klassische Farbbezeichnungen + Anzeigetool

    • UEZ
    • 21. August 2011 um 19:11

    Nette Idee mit den Farben!

    Danke und Gruß,
    UEZ

  • Bilder mit schwarzen Kreisen darstellen

    • UEZ
    • 18. August 2011 um 10:03

    Nette Idee! :thumbup:

    Übrigens: das nennt sich Halftone bzw. auf Deutsch Druckraster: -> http://de.wikipedia.org/wiki/Druckraster

    Appropos Halftone (lag bei mir so rum):

    Spoiler anzeigen
    [autoit]


    #AutoIt3Wrapper_Compile_both=y
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    #AutoIt3Wrapper_UseUpx=y
    #AutoIt3Wrapper_UPX_Parameters=--brute --crp-ms=999999 --all-methods --all-filters
    #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_Obfuscated.au3"
    #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>

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

    Opt("GuiOnEventMode", 1)

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

    Global Const $width = @DesktopWidth * 0.25
    Global Const $height = @DesktopHeight * 0.25
    Global Const $GUI_title = "GDI+ Halftone by UEZ 2011"
    Global Const $hGui = GUICreate($GUI_title, $width, $height)

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

    _GDIPlus_Startup()
    Global $hBMP = _WinAPI_CreateBitmap($width, $height)
    Global $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBMP)
    Global $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    Global $hDC = _WinAPI_GetDC($hGUI)
    Global $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC)
    Global $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBITMAP)
    Global $hGraphic = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer)
    Global Const $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000)
    Global Const $hBrush_Clear = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, 2)
    _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
    GUISetState()

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

    Global $i, $t, $tt, $x, $y, $ii, $distx, $disty, $d, $r
    Global Const $SRCCOPY = 0x00CC0020
    Global Const $circles = 3
    Global $s = 16 ;spacing between dots
    Global $aCircles[$circles][5] ; x, y, dx, dy, m

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

    For $i = 0 To UBound($aCircles) - 1
    $aCircles[$i][0] = Random(0, 1) ;x -> x position
    $aCircles[$i][1] = Random(0, 1) ;y -> y position
    $aCircles[$i][2] = Random(0, 1) * 0.03 ;dx -> speed x vector
    $aCircles[$i][3] = Random(0, 1) * 0.03 ;dy -> speed y vector
    $aCircles[$i][4] = Random(0.08, 0.25) ;m -> mass
    Next

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

    GUISetOnEvent(-3, "_Exit")

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

    Global $fps = 0
    AdlibRegister("FPS", 1000)

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

    Do
    _WinAPI_BitBlt($hDC, 0, 0, $width, $height, $hDC_backbuffer, 0, 0, $SRCCOPY)
    ;~ $t = TimerInit()
    _GDIPlus_GraphicsFillRect($hGraphic, 0, 0, $width, $height, $hBrush_Clear)
    For $i = 0 To $circles - 1 ;move mass centers
    $aCircles[$i][0] += $aCircles[$i][2]
    $aCircles[$i][1] += $aCircles[$i][3]
    If $aCircles[$i][0] > 1 Or $aCircles[$i][0] < 0 Then $aCircles[$i][2] *= -1
    If $aCircles[$i][1] > 1 Or $aCircles[$i][1] < 0 Then $aCircles[$i][3] *= -1
    Next
    For $x = 0 To $width Step $s
    For $y = 0 To $height Step $s
    $ii = 0.2 ;intensity in this dot
    For $i = 0 To $circles - 1 ;sum influence from all mass centers
    $distx = $x - $aCircles[$i][0] * $width ;x distance
    $disty = $y - $aCircles[$i][1] * $height ;y distance
    $d = Sqrt($distx * $distx + $disty * $disty) / ($height + $width) ;dance between current mass center and current dot
    If Not $d Then ;add influence from current mass center (but not too much!)
    $ii += 2
    Else
    $ii += Min($aCircles[$i][4] / ($d * $d * 20), 2)
    EndIf
    Next
    $r = Min($ii, $s) * $s * 0.70
    _GDIPlus_GraphicsFillEllipse($hGraphic, $x + 1, $y + 1, $r, $r, $hBrush)
    Next
    Next
    ;~ $tt = TimerDiff($t)
    ;~ If $tt < 24 Then ;if the time was too short, half the spacing between dots
    ;~ $s /= 2
    ;~ ElseIf $tt > 74 Then ;if the time was too long, increase spacing by 8 pixels
    ;~ $s += 8
    ;~ EndIf
    $fps += 1
    Until Not Sleep(30)

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

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

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

    Func Min($a, $b)
    If $a < $b Then Return $a
    Return $b
    EndFunc ;==>Min

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

    Func _Exit()
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_BrushDispose($hBrush_Clear)
    _WinAPI_SelectObject($hDC_backbuffer, $DC_obj)
    _GDIPlus_GraphicsDispose($hGraphic)
    _WinAPI_DeleteObject($hBMP)
    _GDIPlus_BitmapDispose($hBitmap)
    _WinAPI_DeleteObject($hHBITMAP)
    _WinAPI_ReleaseDC($hGUI, $hDC)
    _GDIPlus_Shutdown()
    GUIDelete($hGui)
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    Gruß,
    UEZ

  • ImageUDF 1

    • UEZ
    • 16. August 2011 um 21:25

    Gefällt mir! Klasse Arbeit!

    Hast du einen Vergleichsbenchmark, wo man den Unterschied messen kann? Z.B. das Beispiel als pur GDI+.

    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™