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

  • Ordnername aus Path auslesen

    • UEZ
    • 15. Oktober 2011 um 23:26

    Probiere mal

    [autoit]


    $name = StringRegExpReplace($path, "^.*\\(.*)$", "$1")

    [/autoit]

    Gruß,
    UEZ

  • AutoIt Windows Screenshooter v1.84 Build 2019-08-18

    • UEZ
    • 13. Oktober 2011 um 12:51
    Zitat von progandy


    Das kommt drauf an. Bei mir passt es ziemlich genau, auch wenn die Maus hakt.
    Du kannst und solltest immer noch _ScreenCapture_Capture zerpflücken, das war mir zu viel Aufwand ;) Wenn du es richtig machst, kannst du dann nämlich auch das letzte DeleteObject aus der Schleife entfernen, es werden dann nur noch Bilddaten ziwschen schon reservierten Speicherbereichen kopiert das sollte schneller sein ohne ein andauerndes CreateCompatibleBitmap / DeleteObject ;)


    Mehr geht glaube ich nicht, außer der WTOB() Funktion:

    Spoiler anzeigen
    [autoit]


    Func Grab2AVI()
    GUISetState(@SW_HIDE, $hGUI)

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

    Local $hGUI_Grab2AVI = GUICreate("", 0, 0, 0, 0, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW, WinGetHandle(AutoItWinGetTitle()))
    GUISetBkColor(0xFF0000, $hGUI_Grab2AVI)
    GUISetState(@SW_SHOW, $hGUI_Grab2AVI)
    Local $aMPos, $hWin, $hWinAncestor, $hWnd, $aRet_prev, $aPos, $q, $fps, $hBmp_AVI
    Local Const $frame_size = 3
    Local $tPoint = DllStructCreate($tagPOINT)
    Local $esc = True
    While Not _IsPressed("1B", $dll) * Sleep(25)
    $aMPos = MouseGetPos()
    DllStructSetData($tPoint, 1, $aMPos[0])
    DllStructSetData($tPoint, 2, $aMPos[1])
    $hWin = _WinAPI_WindowFromPoint($tPoint)
    $hWinAncestor = _WinAPI_GetAncestor($hWin, 2)
    $hWnd = HWnd($hWinAncestor)
    $aRet_prev = -1
    $aPos = WinGetPos($hWnd)
    If $hWnd <> $hGUI_Grab2AVI And $hWnd <> $aRet_prev Then
    $aRet_prev = $hWnd
    WinMove($hGUI_Grab2AVI, "", $aPos[0], $aPos[1], $aPos[2], $aPos[3], 1)
    _GuiHole($hGUI_Grab2AVI, $frame_size, $frame_size, $aPos[2] - 2 * $frame_size, $aPos[3] - 2 * $frame_size, $aPos[2], $aPos[3])
    WinSetOnTop($hGUI_Grab2AVI, 0, 1)
    ToolTip("Press CTRL to start capturing of marked window!" & @LF & @LF & _
    "Windows Size: " & $aPos[2] & " x " & $aPos[3], $aMPos[0] + 10, $aMPos[1] + 10)
    EndIf
    If _IsPressed("11", $dll) Then
    $esc = False
    ExitLoop
    EndIf
    WEnd
    ToolTip("")
    $tPoint = 0
    If Not $esc Then
    For $q = 0 To UBound($aButton_Menu_AVI_Sub1_Item) - 1
    If BitAND(GUICtrlRead($aButton_Menu_AVI_Sub1_Item[$q]), $GUI_CHECKED) = $GUI_CHECKED Then
    $rec_time = $AVI_ReqTime[$q]
    ExitLoop
    EndIf
    Next
    For $q = 0 To UBound($aButton_Menu_AVI_Sub2_Item) - 1
    If BitAND(GUICtrlRead($aButton_Menu_AVI_Sub2_Item[$q]), $GUI_CHECKED) = $GUI_CHECKED Then
    $fps = $AVI_FPS[$q]
    ExitLoop
    EndIf
    Next
    EndIf
    GUIDelete($hGUI_Grab2AVI)
    If $esc Then Return GUISetState(@SW_SHOW, $hGUI)

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

    Local $timestamp = @YEAR & @MON & @MDAY & "_" & @HOUR & @MIN & @SEC & "_"
    Local $WinTitle = StringRegExpReplace(WinGetTitle($hWnd), '(\?|\*|\<|\>|\"|\:|\\)', "")

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

    Local $add_ts = False
    If BitAND(GUICtrlRead($mButton_Menu_AVI_Sub3_Item1), $GUI_CHECKED) = $GUI_CHECKED Then $add_ts = True
    If BitAND(GUICtrlRead($mButton_Menu_AVI_Sub4_Item2), $GUI_CHECKED) = $GUI_CHECKED Then
    $compress_avi = False
    Else
    $compress_avi = True
    EndIf

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

    _StartAviLibrary()
    Local $AVI_Filename = @ScriptDir & "\" & $timestamp & $WinTitle & ".avi"
    Local $AVI_File = _CreateAvi($AVI_Filename, $fps, $aPos[2], $aPos[3])
    If @error Then
    _CloseAvi($AVI_File)
    _StopAviLibrary()
    FileDelete($AVI_Filename)
    GUISetState(@SW_SHOW, $hGUI)
    Return MsgBox(64 + 262144, "Information", "Grab Screen to AVI has been aborted!", 15, $hGUI)
    EndIf

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

    Local $hBitmap_AVI, $hBitmap_AVI_TS, $hBmp_AVI_TS, $OldBMP
    Local $total_FPS = $rec_time * $fps, $fps_c = 1
    Local $fc = 1000 / $fps

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

    Local $k32_dll = DllOpen("kernel32.dll")
    Local $g32_dll = DllOpen("gdi32.dll")
    Local $DC = _WinAPI_GetDC(0)
    Local $hDC = _WinAPI_CreateCompatibleDC($DC)

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

    Local $OldBMP, $bits = DllStructCreate("byte[" & DllStructGetData($AVI_File[3], "biSizeImage") & "]")
    Local $pBits = DllStructGetPtr($bits), $iLines = Abs(DllStructGetData($AVI_File[3], "biHeight"))
    Local $pHeader = DllStructGetPtr($AVI_File[3]), $iSize = DllStructGetSize($bits)

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

    Local $iLeft, $iRight, $iTop, $iBottom
    $iLeft = $aPos[0]
    $iRight = $aPos[0] + $aPos[2]
    $iTop = $aPos[1]
    $iBottom = $aPos[1] + $aPos[3]
    If $iRight = -1 Then $iRight = _WinAPI_GetSystemMetrics($__SCREENCAPTURECONSTANT_SM_CXSCREEN)
    If $iBottom = -1 Then $iBottom = _WinAPI_GetSystemMetrics($__SCREENCAPTURECONSTANT_SM_CYSCREEN)
    Local $iW = $aPos[2]
    Local $iH = $aPos[3]
    $hBmp_AVI = _WinAPI_CreateCompatibleBitmap($DC, $iW, $iH)

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

    Local $rec_timer = TimerInit()
    If $add_ts Then
    Do
    $OldBMP = DllCall($g32_dll, "handle", "SelectObject", "handle", $hDC, "handle", $hBmp_AVI)
    DllCall($g32_dll, "bool", "BitBlt", "handle", $hDC, "int", 0, "int", 0, "int", $iW, "int", $iH, "handle", $DC, "int", $iLeft, "int", $iTop, "dword", $SRCCOPY) ;_WinAPI_BitBlt()

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

    $hBitmap_AVI = DllCall($ghGDIPDll, "int", "GdipCreateBitmapFromHBITMAP", "handle", $hBmp_AVI, "handle", 0, "ptr*", 0)
    $hBitmap_AVI_TS = WTOB($hBitmap_AVI[3], _Now())
    $hBmp_AVI_TS = DllCall($ghGDIPDll, "int", "GdipCreateHBITMAPFromBitmap", "handle", $hBitmap_AVI_TS, "ptr*", 0, "dword", 0xFF000000)

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

    DllCall($g32_dll, "int", "GetDIBits", "handle", $hDC, "handle", $hBmp_AVI_TS[2], "uint", 0, "uint", $iLines, "ptr", $pBits, "ptr", $pHeader, "uint", 0)
    DllCall($g32_dll, "handle", "SelectObject", "handle", $hDC, "handle", $OldBMP[0])
    DllCall($Avi32_Dll, "int", "AVIStreamWrite", "ptr", $AVI_File[1], "long", $AVI_File[2], "long", 1, "ptr", $pBits, "long", $iSize, "long", $AVIIF_KEYFRAME, "ptr*", 0, "ptr*", 0)
    $AVI_File[2] += 1

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

    DllCall ($k32_dll, "none", "Sleep", "dword", $fc)

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

    DllCall($g32_dll, "bool", "DeleteObject", "handle", $hBmp_AVI_TS[2])
    DllCall($ghGDIPDll, "int", "GdipDisposeImage", "handle", $hBitmap_AVI[3])
    DllCall($ghGDIPDll, "int", "GdipDisposeImage", "handle", $hBitmap_AVI_TS)

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

    $fps_c += 1
    Until $fps_c > $total_FPS
    Else
    Do
    ;_ScreenCapture_Capture() reduced
    $OldBMP = DllCall($g32_dll, "handle", "SelectObject", "handle", $hDC, "handle", $hBmp_AVI) ;_WinAPI_SelectObject()
    DllCall($g32_dll, "bool", "BitBlt", "handle", $hDC, "int", 0, "int", 0, "int", $iW, "int", $iH, "handle", $DC, "int", $iLeft, "int", $iTop, "dword", $SRCCOPY) ;_WinAPI_BitBlt()

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

    DllCall($g32_dll, "int", "GetDIBits", "handle", $hDC, "handle", $hBmp_AVI, "uint", 0, "uint", $iLines, "ptr", $pBits, "ptr", $pHeader, "uint", 0) ; _WinAPI_GetDIBits()
    DllCall($g32_dll, "handle", "SelectObject", "handle", $hDC, "handle", $OldBMP[0]) ;_WinAPI_SelectObject()
    DllCall($Avi32_Dll, "int", "AVIStreamWrite", "ptr", $AVI_File[1], "long", $AVI_File[2], "long", 1, "ptr", $pBits, "long", $iSize, "long", $AVIIF_KEYFRAME, "ptr*", 0, "ptr*", 0)
    $AVI_File[2] += 1

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

    DllCall ($k32_dll, "none", "Sleep", "dword", $fc)

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

    $fps_c += 1
    Until $fps_c > $total_FPS
    EndIf
    Local $rec_dur = Round(TimerDiff($rec_timer) / 1000, 2)
    _WinAPI_DeleteObject($hBmp_AVI)
    _WinAPI_SelectObject($DC, $OldBMP[0])
    _WinAPI_ReleaseDC(0, $DC)
    _WinAPI_DeleteDC($hDC)

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

    _CloseAvi($AVI_File)
    _StopAviLibrary()
    DllClose($k32_dll)
    DllClose($g32_dll)

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

    MsgBox(64 + 262144, "Information", _
    "AVI video successfully created: " & @LF & @LF & _
    "Filename: " & $AVI_Filename & @LF & _
    "Filesize: " & Round(FileGetSize($AVI_Filename) / 1024^2, 2) & " MB" & @LF & _
    "Duration: " & $rec_time & " seconds" & @LF & _
    "Frames per second: " & $fps & @LF & _
    "Video resolution: " & $aPos[2] & " x " & $aPos[3] & @LF & _
    "Record duration: " & $rec_dur & " seconds", 30, $hGUI)
    GUISetState(@SW_SHOW, $hGUI)
    Local $show_avi = MsgBox(4 + 48 + 256, "Question", "Open AVI with default viewer?", 15, $hGUI)
    If $show_avi = 6 Then ShellExecute($AVI_Filename)
    EndFunc

    [/autoit]

    Den Text per WinAPI zu schreiben ist schneller, aber nicht leserlicher.

    Warum hast du

    [autoit]


    $t = $fc - TimerDiff($t)
    If $t > 0 Then DllCall ($k32_dll, "none", "Sleep", "DWORD", $t)

    [/autoit]


    verwendet? Was bringt das mehr als nur

    [autoit]


    DllCall ($k32_dll, "none", "Sleep", "dword", $fc)

    [/autoit]


    ?


    Zitat von General Kaboom

    Alter jetzt hab ich alles gesehen...da braucht man mal sowas und in dem moment kommt von irgendwoher die idee hier nachzusehen und *zack* hast du was...da ziehe ich meinen Hut vor dir (sobald ich mal einen anhabe). Sowas geht unter "High LVL Programming", wobei ich natürlich schon sagen muss, das mit die Kommentare im Code fehlen...ich verstehe bis zu 70% des Codes nicht mal ansatzweise, aber das ist Detail und auch ich vergesse ab und zu zu kommentieren...ansonsten wirklich grosse Klasse 5* :thumbup:

    Das mit dem Kommentieren ist immer so eine Sache, eigentlich sollte man das immer machen, um nach einigen Wochen den eigenen Code zu verstehen, aber Faulheit siegt meistens...

    So kompliziert ist der Code eigentlich doch nicht, nur ziemlich viel in der Zwischenzeit. ;)

    Gruß,
    UEZ

  • AutoIt Windows Screenshooter v1.84 Build 2019-08-18

    • UEZ
    • 12. Oktober 2011 um 20:47
    Zitat von Tweaky

    Danke für die neue Version.
    Leider funktioniert es bei mir nicht vollständig.

    Ich will 30 Sekunden aufzeichen.
    Die Aufzeichnugsphase dauert dann 50 Sekunden.
    Während der Aufzeichnung ruckelt die Maus.
    Das Videos ist dann 30 Sekunden lang ?(

    Bei 10 Sekunden sinds 15 Sekunden


    Tja, das ist das Problem bei einer Interpreter Sprache: die Geschwindigkeit.

    progandy's version ist etwas schneller, aber letzt endlich gleiches Problem auch hier - Aufzeichnungslänge ist größer als die Solllänge und die Maus hakt.

    VIELEN DANK FÜRS TESTEN!!!!

    @progandy: danke für die Optimierung! :thumbup:

    Mal sehen, ob man noch mehr heraus holen kann.

    Gruß,
    UEZ

  • AutoIt Windows Screenshooter v1.84 Build 2019-08-18

    • UEZ
    • 12. Oktober 2011 um 16:35
    Zitat von Tweaky


    Hm, gerade ist mir noch was aufgefallen.
    Kann es sein, dass die Dauer nicht stimmt.

    Wenn ich 10 Sekunden einstellen, ist das Video nur 5 Sekunden lang.
    Bei 5 Sekunden nur 3 Sekunden.

    Wenn ich es richtig sehe, läuft das Video einfach zu schnell

    Sollte jetzt gefixt sein!

    Gruß,
    UEZ

  • Prozedurale Grafiken

    • UEZ
    • 11. Oktober 2011 um 15:27

    Sehr interessante Spielerei und sauber programmiert! :thumbup:

    Grafische Spielereien sind i.d.R. "nur brotlose Kunst" und meistens eher was für's Auge und meistens eher selten zu gebrauchen.

    Aber nichts desto trotz finde ich immer wieder klasse, irgend welche grafischen Spielereien zu sehen. Mach weiter so (hast dich sehr gut entwickelt!!!) :thumbup:

    Hauptsache es macht SPPPPPAAAAAAAAASSSSSSSSSSS! ;)

    Gruß,
    UEZ

  • Labels mit durchscheinendem Hintergrund auf PicControls

    • UEZ
    • 10. Oktober 2011 um 14:56

    Ist sehr gut geworden und das ohne ext. Hilfe (C++)! :thumbup:

    Eigentlich wollte ich auch eine Funktion dbzgl. basteln, aber ich muss das Rad ja nicht neu erfinden! ;)

    Gruß,
    UEZ

  • Aus einem String Textzeile isolieren

    • UEZ
    • 9. Oktober 2011 um 18:54

    Ersetze

    [autoit]


    $aFilter = StringRegExp($sende1, "\$GPRMC,(.*),E\*7B", 3)

    [/autoit]

    durch

    [autoit]


    $aFilter = StringRegExp($sende1, "\$GPRMC,(.*,E\*7B)\r", 3)

    [/autoit]

    3 bedeutet: Gibt ein Array mit den globalen Übereinstimmungen zurück (Flag).

    Gruß,
    UEZ

  • Aus einem String Textzeile isolieren

    • UEZ
    • 9. Oktober 2011 um 16:54

    Probiere es mal damit:

    [autoit]


    #include "Func_Serial.au3"
    #include <String.au3>
    ;$ourDll = DllOpen(@SystemDir & "\kernel32.dll")

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

    Global Const $ComPort = 4
    Global Const $Baudrate = 4800
    Global Const $Bits = 8
    Global Const $Parity = 0
    Global Const $Stop = 0
    Global Const $Rts = 0

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

    Local $SendPort = _OpenCOMPort($ComPort, $Baudrate, $Bits, $Parity, $Stop, $Rts)
    If $SendPort = -1 Then MsgBox(0, "Fehler", "Der sendende COM-Port konnte nicht geöffnet werden!")

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

    While 1
    $sende1=_ReceiveStringWait($SendPort,1000,1000)
    $aFilter = StringRegExp($sende1, "\$GPRMC,(.*),E\*7B", 3)
    If Not @error Then ConsoleWrite("Sende1 "&$aFilter[0]&@CRLF)
    WEnd
    _CloseCOMPort($SendPort)

    [/autoit]

    Gruß,
    UEZ

  • Labels mit durchscheinendem Hintergrund auf PicControls

    • UEZ
    • 7. Oktober 2011 um 19:47
    Zitat von funkey

    Wen meinst du, UEZ? :D


    Na dich natürlich :D

    Gruß,
    UEZ

  • Labels mit durchscheinendem Hintergrund auf PicControls

    • UEZ
    • 7. Oktober 2011 um 19:27

    Angeber :P

    Gruß,
    UEZ ;)

  • Teiltransparenter Label-Background

    • UEZ
    • 5. Oktober 2011 um 21:32

    Hier ein Ansatz:

    Spoiler anzeigen
    [autoit]


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

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

    HotKeySet("{ESC}", "_Exit")
    Opt("GUIOnEventMode", 1)

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

    _GDIPlus_Startup()
    ;~ Global Const $IMAGE_BITMAP = 0
    Global Const $STM_SETIMAGE = 0x0172
    Global Const $path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir")
    Global Const $sFile = $path & "\Examples\GUI\msoobe.jpg"
    Global Const $hImage = _GDIPlus_ImageLoadFromFile($sFile)
    Global Const $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    _GDIPlus_ImageDispose($hImage)

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

    Global $iTabs = 9
    Global $iEpisoden = 9
    Global $Episoden[$iEpisoden] = [25, 25, 24, 25, 25, 24, 22, 23, 14]
    Global $aBG[$Episoden[UBound($Episoden) - 2] * $iTabs][2]

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

    Gui()

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

    While 1
    Sleep(100)
    WEnd

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

    Func Gui()
    $kk = 0
    $Breite = 462
    $Hoehe = 266
    $GUI = GUICreate("", $Breite, $Hoehe)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    $idPic = GUICtrlCreatePic("", 2, 22, 458, 242)
    GuiCtrlSetState(-1, $GUI_DISABLE)
    ;~ GUICtrlCreateLabel("", 2, 22, 458, 242) ; anstatt GUICtrlCreatePic
    ;~ GUICtrlSetBkColor(-1, 0xABCDEF) ; anstatt GUICtrlCreatePic
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUICtrlCreateTab(1, 1, $Breite, $Hoehe - 1)
    For $i = 1 To $iTabs
    GUICtrlCreateTabItem("Staffel " & $i)
    For $j = 1 To $Episoden[$i - 1]
    $X_Koord = 10
    $Y_Koord = $j * 18 + 10
    If $j > 13 Then
    $X_Koord = 240
    $Y_Koord = ($j - 13) * 18 + 10
    EndIf
    $Laenge = Random(10, 50, 1)
    $String = "["
    For $k = 1 To $Laenge
    $String &= "."
    Next
    $String &= "]"

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

    $aBG[$kk][0] = GUICtrlCreatePic("", $X_Koord, $Y_Koord)
    $aBG[$kk][1] = Create_BgBitmap(StringLen($j & ". " & $String) * 3.4, 14)
    _WinAPI_DeleteObject(GUICtrlSendMsg($aBG[$kk][0], $STM_SETIMAGE, $IMAGE_BITMAP, $aBG[$kk][1]))
    GUICtrlSetState(-1, $GUI_DISABLE)

    GUICtrlCreateLabel($j & ". " & $String, $X_Koord, $Y_Koord, StringLen($j & ". " & $String) * 3.385, 14)
    GUICtrlSetCursor(-1, 0)
    GUICtrlSetColor(-1, 0x101010)
    GUICtrlSetBkColor(-1, -2)
    $kk += 1
    Next
    Next
    GUISetState(@SW_SHOW)
    _WinAPI_DeleteObject(GUICtrlSendMsg($idPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap))
    _WinAPI_RedrawWindow($GUI)
    EndFunc

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

    Func _Exit()
    For $kk = 0 To UBound($aBG) - 1
    _WinAPI_DeleteObject($aBG[$kk][1])
    Next
    _WinAPI_DeleteObject($hBitmap)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

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

    Func Create_BgBitmap($iWidth, $iHeight, $iColor = 0x10FFFFFF)
    Local Const $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    Local Const $hBitmap = $aResult[6]
    Local Const $hBrush = _GDIPlus_BrushCreateSolid($iColor)
    Local Const $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsFillRect($hContext, 0, 0, $iWidth, $iHeight, $hBrush)
    _GDIPlus_GraphicsDispose($hContext)
    _GDIPlus_BrushDispose($hBrush)
    Return _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    EndFunc

    [/autoit]


    Ist nicht perfekt, aber kannst ja dran schrauben! ;)

    Gruß,
    UEZ

  • Teiltransparenter Label-Background

    • UEZ
    • 5. Oktober 2011 um 15:08

    Um das Stauchen abzustellen, kannst du

    [autoit]


    Global Const $idPic = GUICtrlCreatePic("", 0, 0, $iImgWidth, $iImgHeight)

    [/autoit]

    nehmen.

    Mit den Tabs muss ich mal schauen, ob das funzt.

    Gruß,
    UEZ

  • Teiltransparenter Label-Background

    • UEZ
    • 5. Oktober 2011 um 14:39

    Vielleicht so?

    Spoiler anzeigen
    [autoit]


    ;coded by UEZ 2011
    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    _GDIPlus_Startup()
    Global Const $IMAGE_BITMAP = 0
    Global Const $STM_SETIMAGE = 0x0172

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

    Global Const $path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir")
    Global Const $sFile = $path & "\Examples\GUI\mslogo.jpg"
    Global Const $hImage = _GDIPlus_ImageLoadFromFile($sFile)
    Global Const $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    Global Const $iImgWidth = _GDIPlus_ImageGetWidth($hImage)
    Global Const $iImgHeight = _GDIPlus_ImageGetHeight($hImage)
    Global Const $hGUI = GUICreate("Test", $iImgWidth, $iImgHeight)
    Global Const $idPic = GUICtrlCreatePic("", 0, 0, $iImgWidth, $iImgHeight)
    GuiCtrlSetState(-1, $GUI_DISABLE)
    GUISetState()
    _WinAPI_DeleteObject(GUICtrlSendMsg($idPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap))

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

    Global Const $iLabelW = 130
    Global Const $iLabelH = 25
    Global Const $iLabelX = 0
    Global Const $iLabelY= 0
    Global Const $idLabelBg = GUICtrlCreatePic("", $iLabelX, $iLabelY, $iLabelW, $iLabelH)
    Global Const $hBG_Bitmap = Create_BgBitmap($iLabelW, $iLabelH)
    _WinAPI_DeleteObject(GUICtrlSendMsg($idLabelBg, $STM_SETIMAGE, $IMAGE_BITMAP, $hBG_Bitmap))

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

    Global Const $idLabel = GUICtrlCreateLabel("This is a test!", $iLabelX, $iLabelY, $iLabelW, $iLabelH)
    GUICtrlSetFont(-1, 16)
    GUICtrlSetColor(-1, 0x40FF40)
    GUICtrlSetBkColor(-1, -2)

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

    While True
    $msg = GUIGetMsg()
    Switch $msg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_ImageDispose($hImage)
    _WinAPI_DeleteObject($hBitmap)
    _WinAPI_DeleteObject($hBG_Bitmap)
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
    Exit
    EndSwitch
    WEnd

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

    Func Create_BgBitmap($iWidth, $iHeight, $iColor = 0x80FFFFFF)
    Local Const $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    Local Const $hBitmap = $aResult[6]
    Local Const $hBrush = _GDIPlus_BrushCreateSolid($iColor)
    Local Const $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsFillRect($hContext, 0, 0, $iWidth, $iHeight, $hBrush)
    _GDIPlus_GraphicsDispose($hContext)
    _GDIPlus_BrushDispose($hBrush)
    Return _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • name22 feiert seinen 17ten

    • UEZ
    • 5. Oktober 2011 um 09:19

    Auch von mir alles Gute!

    Gruß,
    UEZ

  • AutoIt Windows Screenshooter v1.84 Build 2019-08-18

    • UEZ
    • 3. Oktober 2011 um 13:13

    Das Fenster, was du siehst, kommt von der Avifil32.dll, die die installienten Codecs auf dem System anzeigt.

    Eine Ini ist nicht geplant, denn du müsstest noch weitere Parameter (siehe $AVICOMPRESSOPTIONS Struktur) mitgeben, die nicht statisch sind.

    Hat jemand DEP aktiviert für alles Programme und Dienste? Wenn ja, dann führt das in Verbindung mit dem Windows Screenshooter zu Problemen, da verschiedene DLL aus dem Speicher geladen werden!
    Z.B: wird stürzt das About Intro und einige Bild Manipulationsfunktionen ab!

    Gruß,
    UEZ

  • AutoIt Windows Screenshooter v1.84 Build 2019-08-18

    • UEZ
    • 2. Oktober 2011 um 21:46

    Tweaky:

    Zu den Codecs: welcher Codec am Besten ist, musst du ausprobieren, denn jeder Codec hat seine Vor- bzw. Nachteile. Du kannst auch XViD oder irgend welche anderen Codecs installieren und benutzen!

    Dauer: hast recht, da stimmt was nicht - muss da nochmals genauer schauen, was da schief läuft.

    Danke für dein Feedback!

    Gruß,
    UEZ

  • Amperemeter mit GDIPlus DLL

    • UEZ
    • 27. September 2011 um 19:41

    Aha, 20 Amperemeter! Ich wüsste nicht, was ich alles anzeigen sollte, aber da hast du recht - bei einem ist AutoIt "schnell" genug.

    Wenn ich was dagegen hätte, würde ich nie den Source Code veröffentlichen und abgesehen davon muss niemand um Erlaubnis für die veröffentlichten Codes fragen :!:

    Ich habe mir schon VS2010 installiert, aber das Monster zu bedienen ist eine Sache, die andere ein simples "Hello World" hinzugekommen. 8|

    Eigene DLLs per Memory Calls in das AutoIt Skript einzubauen ist eine feine Sache. Keine Ahnung, was man mit dem Inline C++ alles anstellen kann, so dass du den Weg über die ext. DLL nicht gehen musst.

    Gruß,
    UEZ

  • Amperemeter mit GDIPlus DLL

    • UEZ
    • 27. September 2011 um 19:10
    Zitat von funkey

    Ich hatte bisher immer die Amperemeter für einige meiner Programme rein mittels AutoIt und der GDIPlus-UDF gezeichnet, das war mir aber zu langsam, deshalb habe ich beschlossen das ganze in eine DLL auszulagern und es lief wie erwartet bedeutend schneller.
    Ich habe 2 Arten von Amperemetern erstellt, einmal zeichne ich direkt auf die Gui, das zweite Mal erstelle ich ein Pic-Control und setze dort das Bitmap. Das zweite hat den Vorteil, das man sich um nichts zu kümmern braucht, was das Neuzeichnen angeht, wenn ein Fenster drübergeschoben wird, allerdings flackert es, wenn man es zu oft updatet.
    Das erste kann man so oft wie nur irgendmöglich updaten und es flackert dank Backbuffer nicht.

    Ich hoffe es kann jemand brauchen, darum teile ich es nun mit euch. C++-Source und AutoIt-Beispiel ist dabei.


    Was meinst du mit "zu langsam"? Um wie viel es ist zu langsam? Mein Visualizer arbeitet eigentlich mit "ordentlicher" Performance, wobei der Hauptcode von 2009 ist und somit noch genug Raum zum Tunen hat!

    Ansonsten möchte ich irgend wann mal C/C++ lernen und bin um jeden Source Code dankbar.

    Gruß,
    UEZ

  • GDI+ Grafik unterschiedlich schnell

    • UEZ
    • 26. September 2011 um 11:27

    Das liegt an der Hauptschleife -> GUIGetMsg()

    Benutze die Opt("GuiOnEventMode", 1) Methode anstelle. Danach sollte der Unterschied weg sein.

    Gruß,
    UEZ

  • CPU Auslastung Auslesen

    • UEZ
    • 24. September 2011 um 21:33

    Mit AutoIt ist es nicht möglich die CPU Last auf alle Kerne zu verteilen, d.h. es wird immer "nur" ein Core eingeheizt.

    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™