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

  • File to Base64 String Code Generator v1.20 Build 2020-06-05

    • UEZ
    • 16. November 2017 um 17:22

    Ich würde das so machen:

    AutoIt
    ...
    _GDIPlus_Startup()
    Global $msg
    Global Const $hGUI = GUICreate("Example", 600, 400)
    Global Const $idLogo = GUICtrlCreatePic("", 215, 20, 169, 68)
    Global Const $idLogo2 = GUICtrlCreatePic("", 215, 150, 169, 68)
    
    ;original
    Global Const $Bmp_Logo = _GDIPlus_BitmapCreateFromMemory(Merlin(), True)
    _WinAPI_DeleteObject(GUICtrlSendMsg($idLogo, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp_Logo))
    
    
    ;Größe verändert >>> so OK?
    Global $Bmp_Logo1 = _GDIPlus_BitmapCreateFromMemory(Merlin()) ;wenn 2. Parameter = True, dann GDI Bild, ansonsten GDIPlus Bild
    Global $iWidth = _GDIPlus_ImageGetWidth($Bmp_Logo1)
    Global $iHeight = _GDIPlus_ImageGetHeight($Bmp_Logo1)
    Global $hBitmap_Resized = _GDIPlus_ImageResize($Bmp_Logo1, 150, 150 * $iHeight / $iWidth) ;resize image
    Global $Bmp_Logo2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_Resized) ;convert GDI+ bitmap to GDI bitmap
    _WinAPI_DeleteObject(GUICtrlSendMsg($idLogo2, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp_Logo2))
    
    _GDIPlus_BitmapDispose($Bmp_Logo1)
    _GDIPlus_BitmapDispose($hBitmap_Resized)
    _WinAPI_DeleteObject($Bmp_Logo)
    _WinAPI_DeleteObject($Bmp_Logo2)
    
    GUISetState()
    
    
    While True
        $msg = GUIGetMsg()
        Switch $msg
            Case $idLogo
                MsgBox(0, "Information", "The picture has been clicked!")
            Case $GUI_EVENT_CLOSE
                _GDIPlus_Shutdown()
                GUIDelete($hGUI)
                Exit
        EndSwitch
    WEnd
    ...
    Alles anzeigen
  • File to Base64 String Code Generator v1.20 Build 2020-06-05

    • UEZ
    • 16. November 2017 um 15:20
    Zitat von Tweaky

    UEZ

    fände es genial, wenn du in die Funktion "Load_BMP_From_Mem" noch eine Option zum ändern der Bildgröße (Breite / Höhe) einbauen könntest.

    Super Tool;)

    Also, "Load_BMP_From_Mem" heißt jetzt "_GDIPlus_BitmapCreateFromMemory" (Raider heißt jetzt Twix, sonst ändert sich nix). :)

    Um die Bildgröße zu ändern, kannst du _GDIPlus_ImageScale oder _GDIPlus_ImageResize benutzen. ;)

  • GetUniqueColors

    • UEZ
    • 15. November 2017 um 22:20

    Nun ja, es sollten auch 32-bit Bilder unterstützt werden, was die schnellste Variante in dieser Version nicht tut.

    Als Beispiel ein Bild mit genau 256 Farben, die nur sich über den Alpha Kanal unterscheiden.

    AutoIt
    #AutoIt3Wrapper_UseX64=n
    #AutoIt3Wrapper_Version=b
    #include <Array.au3>
    #include <GDIPlus.au3>
    
    
    _GDIPlus_Startup()
    Global Const $iW = 256, $iH = 1
    Global $hImage = _GDIPlus_BitmapCreateFromScan0($iW, $iH)
    Global $iX, $iY
    Global $fTimer = TimerInit()
    For $iY = 0 To $iH - 1
        For $iX = 0 To $iW - 1
            _GDIPlus_BitmapSetPixel($hImage, $iX, $iY, BitShift($iX, -24) + 0xFFFF00)
        Next
    Next
    ConsoleWrite("Test image created in " & Round(TimerDiff($fTimer), 2) & " ms" & @CRLF)
    ;~ Global $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Test.png")
    _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Test.png")
    
    $fTimer = TimerInit()
    ;~ Global $iColorCount = _GetUniqueColors($hImage)
    Global $iColorCount = _GDIPlus_ImageGetColorCount5($hImage)
    Global $fEndTime = Round(TimerDiff($fTimer), 2)
    MsgBox(0, "Color Counter", "Found " & $iColorCount & " unique colors in " & $fEndTime & " ms.")
    ConsoleWrite("Found " & $iColorCount & " unique colors" & @CRLF)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
    
    Func _GetUniqueColors(ByRef $hImage)
        Local $aColor[0xFFFFFF + 1], $iColorCounter = 0
        Local $iW, $iH, $tBitmapData, $pScan0, $tPixel, $iOffset, $iColor
        $iW = _GDIPlus_ImageGetWidth($hImage)
        $iH = _GDIPlus_ImageGetHeight($hImage)
        $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
        $pScan0 = DllStructGetData($tBitmapData, 'Scan0')
        $tPixel = DllStructCreate('uint[' & $iW * $iH & '];', $pScan0)
        ConsoleWrite('$iW * $iH = ' & $iW * $iH & ' px' & @CRLF)
        For $iY = 0 To $iH - 1
            $iOffset = $iY * $iW + 1
            For $iX = 0 To $iW - 1
                $iColor = DllStructGetData($tPixel, 1, $iOffset + $iX) - 0xFF000000
                $aColor[$iColor] += 1
                If $aColor[$iColor] = 1 Then $iColorCounter += 1
            Next
        Next
        _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData)
        $tPixel = 0
        Return $iColorCounter
    EndFunc
    
    Func _GDIPlus_ImageGetColorCount5($hImage) ;
        Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage)
        Local $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32RGB)
        Local $iScan0 = DllStructGetData($tBitmapData, "Scan0")
        Local $tPixel = DllStructCreate("uint[" & $iW * $iH & "];", $iScan0)
        Local $iColorCount = 0, $aColors[0xFFFFFFFF]
        If @error Then Return SetError(1, 0, -1) ;internal error
        Local $iX, $iY, $iPos
        For $iY = 0 To $iH - 1
            $iRowOffset = $iY * $iW + 1
            For $iX = 0 To $iW - 1
                $iPos = DllStructGetData($tPixel, 1, $iRowOffset + $iX)
                If Not $aColors[$iPos] Then
                    $aColors[$iPos] = 1
                    $iColorCount += 1
                EndIf
            Next
        Next
        _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData)
        Return $iColorCount
    EndFunc   ;==>_GDIPlus_ImageGetColorCount5
    
    Func _GDIPlus_ImageGetColorCount1($hImage) ;fastest but uses a lot of memory for huge images!
        Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage)
        If $iW * $iH > 2 ^ 24 Then Return SetError(1, 0, -1) ;will cause memory issues
        Local Const $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
        Local Const $iScan0 = $tBitmapData.Scan0
        Local $tPixel = DllStructCreate("byte Binary[" & $iW * $iH * 4 & "];", $iScan0)
        Local $bData = $tPixel.Binary
        _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData)
        Local $aResult = StringRegExp($bData, "[[:xdigit:]]{8}", 3), $y, $s, $iColorCount = 0
        If $iW * $iH <> UBound($aResult) Then Return SetError(1, 0, -2) ;internal error
        For $y = 0 To UBound($aResult) - 1
            $s = "_" & $aResult[$y] & "_"
            If Not IsDeclared($s) Then
                Assign($s, 0, 1)
                $iColorCount += 1
            EndIf
        Next
        $bData = Null
        $tPixel = Null
        $aResult = Null
        Return $iColorCount
    EndFunc   ;==>_GDIPlus_ImageGetColorCount1
    
    Func _GDIPlus_ImageGetColorCount2($hImage) ;fast
        Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage)
        If $iW * $iH > 2 ^ 24 Then Return SetError(1, 0, -1) ;will cause memory issues
        Local Const $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
        Local Const $iScan0 = $tBitmapData.Scan0
        Local $tPixel = DllStructCreate("byte Binary[" & $iW * $iH * 4 & "];", $iScan0)
        Local $bData = $tPixel.Binary
        _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData)
        Local $aResult = StringRegExp($bData, "[[:xdigit:]]{8}", 3), $y, $s, $iColorCount = 0
        If $iW * $iH <> UBound($aResult) Then Return SetError(1, 0, -2) ;internal error
        $f = TimerInit()
        $aResult = _ArrayUnique($aResult)
        $bData = Null
        $tPixel = Null
        Return $aResult[0]
    EndFunc   ;==>_GDIPlus_ImageGetColorCount2
    
    Func _GDIPlus_ImageGetColorCount3($hImage) ;slow
        Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage)
        Local $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32RGB)
        Local $iScan0 = DllStructGetData($tBitmapData, "Scan0")
        Local $tPixel = DllStructCreate("uint[" & $iW * $iH & "];", $iScan0)
        Local $iColorCount = 0, $aColors[$iW * $iH]
        If @error Then Return SetError(1, 0, -1) ;internal error
        Local $iX, $iY, $iZ = 0
        For $iY = 0 To $iH - 1
            $iRowOffset = $iY * $iW + 1
            For $iX = 0 To $iW - 1
                $aColors[$iZ] = DllStructGetData($tPixel, 1, $iRowOffset + $iX) ;get pixel color
                $iZ += 1
            Next
        Next
        $aColors = _ArrayUnique($aColors, 0, 0, 0, $ARRAYUNIQUE_COUNT, 0)
        _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData)
        Return $aColors[0]
    EndFunc   ;==>_GDIPlus_ImageGetColorCount3
    Alles anzeigen
  • GetUniqueColors

    • UEZ
    • 14. November 2017 um 18:58

    Ich hatte das hier mal zusammengestellt:

    AutoIt
    #AutoIt3Wrapper_UseX64=n
    #AutoIt3Wrapper_Version=b
    #include <Array.au3>
    #include <GDIPlus.au3>
    
    
    Global $sFile = FileOpenDialog("Select an image", "", "Image (*.jpg;*.png;*.bmp;*.gif)")
    If @error Then Exit
    _GDIPlus_Startup()
    Global Const $hImage = _GDIPlus_ImageLoadFromFile($sFile)
    Global $fTimer = TimerInit()
    Global $iColorCount = _GDIPlus_ImageGetColorCount2($hImage)
    Global $fEndTime = Round(TimerDiff($fTimer), 2)
    MsgBox(0, "Color Counter", "Found " & $iColorCount & " unique colors in " & $fEndTime & " ms.")
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
    
    
    Func _GDIPlus_ImageGetColorCount1($hImage) ;fastest but uses a lot of memory for huge images!
        Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage)
        If $iW * $iH > 2 ^ 24 Then Return SetError(1, 0, -1) ;will cause memory issues
        Local Const $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
        Local Const $iScan0 = $tBitmapData.Scan0
        Local $tPixel = DllStructCreate("byte Binary[" & $iW * $iH * 4 & "];", $iScan0)
        Local $bData = $tPixel.Binary
        _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData)
        Local $aResult = StringRegExp($bData, "[[:xdigit:]]{8}", 3), $y, $s, $iColorCount = 0
        If $iW * $iH <> UBound($aResult) Then Return SetError(1, 0, -2) ;internal error
        For $y = 0 To UBound($aResult) - 1
            $s = "_" & $aResult[$y] & "_"
            If Not IsDeclared($s) Then
                Assign($s, 0, 1)
                $iColorCount += 1
            EndIf
        Next
        $bData = Null
        $tPixel = Null
        $aResult = Null
        Return $iColorCount
    EndFunc   ;==>_GDIPlus_ImageGetColorCount1
    
    Func _GDIPlus_ImageGetColorCount2($hImage) ;fast
        Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage)
        If $iW * $iH > 2 ^ 24 Then Return SetError(1, 0, -1) ;will cause memory issues
        Local Const $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
        Local Const $iScan0 = $tBitmapData.Scan0
        Local $tPixel = DllStructCreate("byte Binary[" & $iW * $iH * 4 & "];", $iScan0)
        Local $bData = $tPixel.Binary
        _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData)
        Local $aResult = StringRegExp($bData, "[[:xdigit:]]{8}", 3), $y, $s, $iColorCount = 0
        If $iW * $iH <> UBound($aResult) Then Return SetError(1, 0, -2) ;internal error
        $f = TimerInit()
        $aResult = _ArrayUnique($aResult)
        $bData = Null
        $tPixel = Null
        Return $aResult[0]
    EndFunc   ;==>_GDIPlus_ImageGetColorCount2
    
    Func _GDIPlus_ImageGetColorCount3($hImage) ;slow
        Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage)
        Local $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32RGB)
        Local $iScan0 = DllStructGetData($tBitmapData, "Scan0")
        Local $tPixel = DllStructCreate("uint[" & $iW * $iH & "];", $iScan0)
        Local $iColorCount = 0, $aColors[$iW * $iH]
        If @error Then Return SetError(1, 0, -1) ;internal error
        Local $iX, $iY, $iZ = 0
        For $iY = 0 To $iH - 1
            $iRowOffset = $iY * $iW + 1
            For $iX = 0 To $iW - 1
                $aColors[$iZ] = DllStructGetData($tPixel, 1, $iRowOffset + $iX) ;get pixel color
                $iZ += 1
            Next
        Next
        $aColors = _ArrayUnique($aColors, 0, 0, 0, $ARRAYUNIQUE_COUNT, 0)
        _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData)
        Return $aColors[0]
    EndFunc   ;==>_GDIPlus_ImageGetColorCount3
    
    Func _GDIPlus_ImageGetColorCount4($hImage) ;very slow
        Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage)
        Local $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32RGB)
        Local $iScan0 = DllStructGetData($tBitmapData, "Scan0")
        Local $tPixel = DllStructCreate("uint[" & $iW * $iH & "];", $iScan0)
        Local $iColorCount = 0, $oSD = ObjCreate("Scripting.Dictionary")
        If @error Then Return SetError(1, 0, -1) ;internal error
        Local $iX, $iY
        For $iY = 0 To $iH - 1
            $iRowOffset = $iY * $iW + 1
            For $iX = 0 To $iW - 1
                $iPixel = DllStructGetData($tPixel, 1, $iRowOffset + $iX) ;get pixel color
                If Not $oSD.Exists($iPixel) Then
                    $iColorCount += 1
                    $oSD.Add($iPixel, $iColorCount)
                EndIf
            Next
        Next
        _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData)
        $oSD.RemoveAll()
        Return $iColorCount
    EndFunc   ;==>_GDIPlus_ImageGetColorCount4
    Alles anzeigen
  • GDI+ Transparenz Problem bei Bildüberlappung

    • UEZ
    • 27. Oktober 2017 um 23:36

    Hier ein Lösungsansatz:

    AutoIt
    ;coded by UEZ
    
    #include <GDIPlus.au3>
    #include <GuiConstantsEx.au3>
    #include <WindowsConstants.au3>
    
    _GDIPlus_Startup()
    Global $hGUI, $bExit
    Global Const $iW = @DesktopWidth * 0.95, $iH = @DesktopHeight * 0.90, $iWh = $iW / 2, $iHh = $iH / 2, $sTitle = "GDI+ Test"
    
    AutoItSetOption("GUIOnEventMode", 1)
    
    GDIPlus_Test()
    
    AutoItSetOption("GUIOnEventMode", 0)
    _GDIPlus_Shutdown()
    
    
    Func GDIPlus_Test()
        $bExit = False
        $hGUI = GUICreate($sTitle, $iW, $iH)
        GUISetState(@SW_SHOW, $hGUI)
    
        Local Const $hDC = _WinAPI_GetDC($hGUI)
        Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iW, $iH)
        Local Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC)
        Local Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap)
        Local Const $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer)
        _GDIPlus_GraphicsSetSmoothingMode($hCanvas, $GDIP_SMOOTHINGMODE_HIGHQUALITY)
        _GDIPlus_GraphicsSetPixelOffsetMode($hCanvas, $GDIP_PIXELOFFSETMODE_HIGHQUALITY)
    
        Local $aSprites[3][6], $i, $iDX, $iDY, $iControl, $aInfo, $aCtrlPos
        For $i = 0 To UBound($aSprites) - 1
            $aSprites[$i][0] = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\tree0" & $i + 1 & "_01.png")
            $aSprites[$i][1] = _GDIPlus_ImageGetWidth($aSprites[$i][0])
            $aSprites[$i][2] = _GDIPlus_ImageGetHeight($aSprites[$i][0])
            $aSprites[$i][3] = Random(0, $iW - $aSprites[$i][1], 1)
            $aSprites[$i][4] = Random(0, $iH - $aSprites[$i][2], 1)
            $aSprites[$i][5] = GUICtrlCreateLabel("", $aSprites[$i][3], $aSprites[$i][4], $aSprites[$i][1], $aSprites[$i][2])
            GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
            _GDIPlus_GraphicsDrawImageRect($hCanvas, $aSprites[$i][0], $aSprites[$i][3], $aSprites[$i][4], $aSprites[$i][1], $aSprites[$i][2])
        Next
    
        Local Const $hBrush_Clr = _GDIPlus_BrushCreateSolid(0xFFA0A0A0), _
                    $hBrush_FPS = _GDIPlus_BrushCreateSolid(0xF0101010)
    
        $iFPS = 0
        GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About")
    
        Do
            DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush_Clr, "float", 0, "float", 0, "float", $iW, "float", $iH)
            $aInfo = GUIGetCursorInfo($hGUI)
            If $aInfo[2] And $aInfo[4] Then
                $iControl = FindCtrl($aInfo[4], $aSprites)
                If Not @error Then
                    $iDX = Abs(MouseGetPos(0) - $aSprites[$iControl][3])
                    $iDY = Abs(MouseGetPos(1) - $aSprites[$iControl][4])
                    Do
                        DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush_Clr, "float", 0, "float", 0, "float", $iW, "float", $iH)
                        $aInfo = GUIGetCursorInfo($hGUI)
                        $aCtrlPos = ControlGetPos($hGUI, "", $aSprites[$iControl][5])
                        $aSprites[$iControl][3] = MouseGetPos(0) - $iDX
                        $aSprites[$iControl][4] = MouseGetPos(1) - $iDY
                        For $i = 0 To UBound($aSprites) - 1
                            _GDIPlus_GraphicsDrawImageRect($hCanvas, $aSprites[$i][0], $aSprites[$i][3], $aSprites[$i][4], $aSprites[$i][1], $aSprites[$i][2])
                        Next
                        _WinAPI_BitBlt($hDC, 0, 0, $iW, $iH, $hDC_backbuffer, 0, 0, $SRCCOPY)
                    Until Not $aInfo[2]
                    ControlMove($hGUI, "", $aSprites[$iControl][5], $aSprites[$iControl][3], $aSprites[$iControl][4])
                EndIf
            Else
                For $i = 0 To UBound($aSprites) - 1
                    _GDIPlus_GraphicsDrawImageRect($hCanvas, $aSprites[$i][0], $aSprites[$i][3], $aSprites[$i][4], $aSprites[$i][1], $aSprites[$i][2])
                Next
            EndIf
    
            _WinAPI_BitBlt($hDC, 0, 0, $iW, $iH, $hDC_backbuffer, 0, 0, $SRCCOPY)
            If $bExit Then ExitLoop
        Until Not Sleep(10)
    
        For $i = 0 To UBound($aSprites) - 1
            _GDIPlus_ImageDispose($aSprites[$i][0])
        Next
        _GDIPlus_BrushDispose($hBrush_Clr)
        _GDIPlus_BrushDispose($hBrush_FPS)
        _GDIPlus_GraphicsDispose($hCanvas)
        _WinAPI_SelectObject($hDC_backbuffer, $DC_obj)
        _WinAPI_DeleteDC($hDC_backbuffer)
        _WinAPI_DeleteObject($hHBitmap)
        _WinAPI_ReleaseDC($hGUI, $hDC)
        GUIDelete($hGUI)
    EndFunc   ;==>GDIPlus_Test
    
    Func FindCtrl($iCtrl, $aArray)
        Local $i
        For $i = 0 To UBound($aArray) - 1
            If $aArray[$i][5] = $iCtrl Then Return $i
        Next
        Return SetError(0, 0, -1)
    EndFunc
    
    Func _Exit_About()
        $bExit = True
    EndFunc   ;==>_Exit_About
    Alles anzeigen
  • GDIPlus - Bereich immun machen

    • UEZ
    • 8. September 2017 um 21:43

    Du musst die Positionen der Controls ermitteln und sie dann ausclippen.

    Hier ein älteres Beispiel:

    AutoIt
    #AutoIt3Wrapper_UseX64=n
    ;coded by UEZ 2009
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GDIplus.au3>
    #include <WindowsConstants.au3>
    
    Local Const $width = @DesktopWidth / 2
    Local Const $height = @DesktopHeight / 2
    Opt("GUIOnEventMode", 1)
    
    Local $fps = 0, $fps_diff, $fps_maintimer, $fps_timer, $display_FPS = -15
    Local $trig = ACos(-1)  / 180
    Local $max_dots = 100
    Local $max_speed = 8
    Local $iWidth = 10
    Local $iHeight = 10
    Local $hGUI = GUICreate("Border Collision with " & $max_dots & " objects! 0 FPS", $width, $height, -1, -1, Default, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
    Local $Button = GUICtrlCreateButton("Exit", $width / 2 - 50, $height / 2 - 15, 100, 30)
    Local $Input = GUICtrlCreateInput("Coded by UEZ", $width / 4, $height - 40, $width / 2, 20, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
    
    _GDIPlus_Startup()
    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($Width, $Height, $hGraphics)
    $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)
    Local $hBrush_Clear = _GDIPlus_BrushCreateSolid(0xFF000000)
    
    ;~ Global Const $GW_CHILD = 5
    ;~ Global Const $GW_HWNDNEXT = 2
    Global $hRegion = _GDIPlus_RegionCreateFromRect(0, 0, $width, $height)
    Global $hChild = _WinAPI_GetWindow($hGUI, $GW_CHILD)
    Global $aRect
    Do
        $aRect = ControlGetPos($hChild, "", 0)
        _GDIPlus_RegionCombineRect($hRegion, $aRect[0], $aRect[1], $aRect[2], $aRect[3], 3)
        $hChild = _WinAPI_GetWindow($hChild, $GW_HWNDNEXT)
    Until Not $hChild
    _GDIPlus_GraphicsSetClipRegion($hGraphics, $hRegion)
    _GDIPlus_RegionDispose($hRegion)
    
    GUISetState()
    
    GUICtrlSetOnEvent($Button, "Close")
    
    
    Dim $coordinates[$max_dots][5], $angle
    Dim $hBrush[$max_dots]
    Initialize()
    
    $fps_maintimer = TimerInit()
    Do
        For $x = -0x7FFFFFFF To 0x7FFFFFFF
            $fps_timer = TimerInit()
            Draw_Dots()
            Calculate_New_Position()
            Sleep(30)
            $fps_diff = TimerDiff($fps_timer)
            If TimerDiff($fps_maintimer) > 999 Then ;calculate FPS
                $fps = Round(1000 / $fps_diff, 2)
                $fps_maintimer = TimerInit()
            EndIf
            WinSetTitle($hGUI, "", "Border Collision with " & $max_dots & " objects! " & $fps & " FPS")
        Next
    Until False
    
    Func Initialize()
        For $k = 0 To $max_dots - 1
            $hBrush[$k] = _GDIPlus_BrushCreateSolid(Random(0xD0808080, 0xD0FFFFFF, 1))
            New_Coordinates($k)
        Next
    EndFunc   ;==>Initialize
    
    Func Draw_Dots()
        Local $i, $temp_x, $temp_y
        _GDIPlus_GraphicsFillRect($hBackbuffer, 0, 0, $width, $height, $hBrush_Clear)
        For $i = 0 To $max_dots - 1
            _GDIPlus_GraphicsFillEllipse($hBackbuffer, $coordinates[$i][0], $coordinates[$i][1], $iWidth, $iHeight, $hBrush[$i])
        Next
        _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $width, $height)
    EndFunc   ;==>Draw_Dots
    
    Func New_Coordinates($k)
        $coordinates[$k][0] = $width / 2 ;Random($width / 20, $width - $width / 20, 1);start x position
        $coordinates[$k][1] = $height / 2 ;Random($height / 20, $height - $height / 20, 1) ;start y position
        $coordinates[$k][2] = Random(1, $max_speed, 1) ;speed of pixel
        $angle = Random(0, 359, 1)
    ;~ ConsoleWrite("Angle: " & $angle & "°" & @CRLF)
        $coordinates[$k][3] = $coordinates[$k][2] * Cos($angle * $trig)
        $coordinates[$k][4] = $coordinates[$k][2] * Sin($angle * $trig)
    EndFunc   ;==>New_Coordinates
    
    Func Calculate_New_Position()
        Local $k
        For $k = 0 To $max_dots - 1
            $coordinates[$k][0] += $coordinates[$k][3] ;increase x coordinate with appropriate slope
            $coordinates[$k][1] += $coordinates[$k][4] ;increase y coordinate with appropriate slope
            If $coordinates[$k][0] <= 0 Then ;border collision x left
                $coordinates[$k][0] = 1
                $coordinates[$k][3] *= -1
            ElseIf $coordinates[$k][0] >= $width - $iWidth Then ;border collision x right
                $coordinates[$k][0] = $width - ($iWidth + 1)
                $coordinates[$k][3] *= -1
            EndIf
            If $coordinates[$k][1] <= 0 Then ;border collision y top
                $coordinates[$k][1] = 1
                $coordinates[$k][4] *= -1
            ElseIf $coordinates[$k][1] >= $height - $iHeight Then ;border collision y bottom
                $coordinates[$k][1] = $height - ($iHeight + 1)
                $coordinates[$k][4] *= -1
            EndIf
        Next
    EndFunc   ;==>Calculate_New_Position
    
    Func close()
        For $k = 0 To $max_dots - 1
            _GDIPlus_BrushDispose($hBrush[$k])
        Next
        _GDIPlus_BrushDispose($hBrush_Clear)
        _GDIPlus_GraphicsDispose($hBackbuffer)
        _GDIPlus_BitmapDispose($hBitmap)
        _GDIPlus_GraphicsDispose($hGraphics)
        _GDIPlus_Shutdown()
        Exit
    EndFunc   ;==>close
    Alles anzeigen
  • Genial einfaches Tool zur Web Recherche - Smartclip

    • UEZ
    • 16. August 2017 um 23:59
    Zitat von Tuxedo

    Wenn ich noch 30 Jahre jünger wäre und gut Englisch könnte, würde ich auf C++ oder Delphi umsteigen und es dort verwirklichen.

    In C++ oder Delphi ist der Code ähnlich, nur komplizierter, da du auch die WinAPI Funktionen selber schreiben musst. ;)

    Modus 2 ist im PNG Binär Format und wird nur von wenigen Programmen, wie z.B. Paint.Net, unterstützt.
    Modus 3 wir sogar in Paint.Net transparent angezeigt.

    Apropos Englisch, ohne Englisch kommt man heute leider nicht weit, aber gibt ja Google Translate. ^^

  • String auf spezielles Format untersuchen

    • UEZ
    • 16. August 2017 um 23:38

    Kann man das Ganze nicht mit der Funktion Execute() erschlagen oder zumindest den größten Teil?

    AutoIt
    ConsoleWrite(Execute("1") & @CRLF)
    ConsoleWrite(Execute("2.3") & @CRLF)
    ConsoleWrite(Execute("-0") & @CRLF)
    ConsoleWrite(Execute("-0.12e-1") & @CRLF)
    ConsoleWrite(Execute("22.123912e+3") & @CRLF)
    ConsoleWrite(Execute("0e12") & @CRLF)
    
    
    ConsoleWrite(Execute("-0A") & @CRLF)
    ConsoleWrite(Execute("1e12e20") & @CRLF)
  • Genial einfaches Tool zur Web Recherche - Smartclip

    • UEZ
    • 16. August 2017 um 23:11

    Hast du alle 3 Modi getestet?

    Und wie gesagt unterstützt nicht jede Applikation die Formate DIBv5 und PNG.

    In Excel kann ich z.B. das PNG Format benutzen. XnView unterstützt partiell DIBv5.

  • Genial einfaches Tool zur Web Recherche - Smartclip

    • UEZ
    • 16. August 2017 um 17:17

    Ich habe die _WinAPI_BitmapCopyToClipboard() Funktion ein wenig erweitert:

    AutoIt
    #include <Clipboard.au3>
    #include <GDIPlus.au3>
    #include <Memory.au3>
    
    
    _GDIPlus_Startup()
    Global $sFile = StringReplace(@AutoItExe, "autoit3.exe", "Examples\GUI\Torus.png")
    Global $hImage = _GDIPlus_ImageLoadFromFile($sFile)
    
    
    If _WinAPI_BitmapCopyToClipboard($hImage) Then
    	MsgBox(0, "Info", "Image copied to clipboard", 30)
    Else
    	MsgBox(16, "Error", "An error has occured: " & @error, 30)
    EndIf
    
    
    
    
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
    
    
    ; #FUNCTION# ====================================================================================================================
    ; Name ..........: _WinAPI_BitmapCopyToClipboard
    ; Description ...: Copies a GDIPlus bitmap to the clipboard using CF_DIBV5, CF_BITMAP or PNG format.
    ; Syntax ........: _WinAPI_BitmapCopyToClipboard($hImage)
    ; Parameters ....: $hImage              - a GDIPlus bitmap handle.
    ;                  $iMode               - [optional] an integer value. Default is 3.
    ; Return values .: True on success otherwise False
    ; Author ........: UEZ
    ; Modified ......:
    ; Remarks .......: It copies the color values from a GDIPlus bitmap to a device-independent bitmap (DIB) v5 32-bit or raw PNG data
    ;				   (mode 1 and 2) to support transparent bitmaps (might not supported by an application).
    ; Links .........: $tagBITMAPV5HEADER -> http://msdn.microsoft.com/en-us/library/windows/desktop/dd183381(v=vs.85).aspx
    ; Version .......: 2017-08-16
    ; Example .......: No
    ; ===============================================================================================================================
    Func _WinAPI_BitmapCopyToClipboard($hImage, $iMode = 3)
    	If _ClipBoard_Open(0) Then
    		If _ClipBoard_Empty() Then
    			$iMode = $iMode < 1 ? 1 : $iMode > 3 ? 3 : $iMode
    			Switch $iMode
    				Case 1
    					Local Const $aDim = _GDIPlus_ImageGetDimension($hImage)
    					If @error Then Return SetError(3, 0, False)
    					Local Const $iW = $aDim[0], $iH = $aDim[1]
    					Local $tBMPData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
    					If @error Then Return SetError(4, 0, False)
    					Local Const $iBmpSize = $iH * $tBMPData.Stride
    					Local $tBIV5HDR = DllStructCreate($tagBITMAPV5HEADER)
    					Local Const $iBuffLen = DllStructGetSize($tBIV5HDR) + $iBmpSize
    					Local $hMem = _MemGlobalAlloc($iBuffLen + 1, $GHND)
    					Local Const $pDIBV5 = _MemGlobalLock($hMem)
    					$tBIV5HDR = DllStructCreate($tagBITMAPV5HEADER, $pDIBV5)
    					With $tBIV5HDR
    						.bV5Size = DllStructGetSize($tBIV5HDR)
    						.bV5Width = $iW
    						.bV5Height = $iH
    						.bV5Planes = 1
    						.bV5BitCount = 32
    						.biCompression = $BI_RGB
    						.bV5ClrUsed = 0
    						.bV5ClrImportant = 0
    						.bV5SizeImage = 0
    						.bV5CSType = 2
    						.bV5Intent = 4
    						.bV5AlphaMask = 0xFF000000
    						.bV5RedMask = 0x00FF0000
    						.bV5GreenMask = 0x0000FF00
    						.bV5BlueMask = 0x000000FF
    					EndWith
    
    
    					Local $pBits
    					Local Const $hBitmap = _WinAPI_CreateDIBSection(0, $tBIV5HDR, $DIB_RGB_COLORS, $pBits)
    
    
    					_WinAPI_SetBitmapBits($hBitmap, $iBuffLen, $tBMPData.Scan0)
    
    
    					_MemMoveMemory($pBits, $pDIBV5 + $tBIV5HDR.bV5Size, $iBmpSize)
    
    
    					Local $iError = 0
    					If Not _ClipBoard_SetDataEx($hMem, $CF_DIBV5) Then $iError += 1
    
    
    					_GDIPlus_BitmapUnlockBits($hImage, $tBMPData)
    					_MemGlobalUnlock($pDIBV5)
    					_MemGlobalFree($hMem)
    					_WinAPI_DeleteObject($hBitmap)
    					If $iError Then Return SetError(5, 0, False)
    				Case 2
    					Local $binImage = _GDIPlus_StreamImage2BinaryString($hImage, "PNG")
    					If @error Then Return SetError(6, 0, False)
    					Local $iFormat = _ClipBoard_RegisterFormat("PNG")
    					If Not _ClipBoard_SetData($binImage, $iFormat) Then
    						$binImage = 0
    						Return SetError(7, 0, False)
    					EndIf
    					$binImage = 0
    				Case 3
    					Local Const $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    					If @error Then Return SetError(8, 0, False)
    					Local $hHBmp_Clipboard = _WinAPI_CopyImage($hHBmp, $IMAGE_BITMAP, 0, 0, BitOR($LR_COPYDELETEORG, $LR_COPYRETURNORG))
    					_ClipBoard_SetDataEx($hHBmp_Clipboard, $CF_BITMAP)
    					_WinAPI_DeleteObject($hHBmp)
    					_WinAPI_DeleteObject($hHBmp_Clipboard)
    			EndSwitch
    		Else
    			Return SetError(2, 0, False)
    		EndIf
    		_ClipBoard_Close()
    	Else
    		Return SetError(1, 0, False)
    	EndIf
    	Return True
    EndFunc   ;==>_WinAPI_BitmapCopyToClipboard
    
    
    Func _GDIPlus_StreamImage2BinaryString($hBitmap, $sFormat = "JPG", $iQuality = 80, $bSave = False, $sFilename = @ScriptDir & "\Converted.jpg") ;coded by UEZ 2013 build 2014-01-25 (based on the code by Andreik)
    	Local $sImgCLSID, $tGUID, $tParams, $tData
    	Switch $sFormat
    		Case "JPG"
    			$sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat)
    			$tGUID = _WinAPI_GUIDFromString($sImgCLSID)
    			$tData = DllStructCreate("int Quality")
    			$iQuality = $iQuality < 0 ? 0 : $iQuality > 100 ? 100 : $iQuality
    			DllStructSetData($tData, "Quality", $iQuality) ;quality 0-100
    			Local $pData = DllStructGetPtr($tData)
    			$tParams = _GDIPlus_ParamInit(1)
    			_GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData)
    		Case "PNG", "BMP", "GIF", "TIF"
    			$sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat)
    			$tGUID = _WinAPI_GUIDFromString($sImgCLSID)
    		Case Else
    			Return SetError(1, 0, 0)
    	EndSwitch
    	Local $hStream = _WinAPI_CreateStreamOnHGlobal() ;http://msdn.microsoft.com/en-us/library/ms864401.aspx
    	If @error Then Return SetError(2, 0, 0)
    	_GDIPlus_ImageSaveToStream($hBitmap, $hStream, DllStructGetPtr($tGUID), DllStructGetPtr($tParams))
    	If @error Then Return SetError(3, 0, 0)
    
    
    	Local $hMemory = _WinAPI_GetHGlobalFromStream($hStream) ;http://msdn.microsoft.com/en-us/library/aa911736.aspx
    	If @error Then Return SetError(4, 0, 0)
    	Local $iMemSize = _MemGlobalSize($hMemory)
    	If Not $iMemSize Then Return SetError(5, 0, 0)
    	Local $pMem = _MemGlobalLock($hMemory)
    	$tData = DllStructCreate("byte[" & $iMemSize & "]", $pMem)
    	Local $bData = DllStructGetData($tData, 1)
    	_WinAPI_ReleaseStream($hStream) ;http://msdn.microsoft.com/en-us/library/windows/desktop/ms221473(v=vs.85).aspx
    	_MemGlobalFree($hMemory)
    	If $bSave Then
    		Local $hFile = FileOpen($sFilename, 18)
    		If @error Then Return SetError(6, 0, $bData)
    		FileWrite($hFile, $bData)
    		FileClose($hFile)
    	EndIf
    	Return $bData
    EndFunc   ;==>_GDIPlus_StreamImage2BinaryString
    Alles anzeigen

    Je nach Anwendung funktioniert der jeweilige Modus.

  • Genial einfaches Tool zur Web Recherche - Smartclip

    • UEZ
    • 15. August 2017 um 21:59

    Soweit ich es verstanden habe, willst du 32-bit Bitmaps mit Transparenz in den Clipboard kopieren.

    Versuche es mal mit dieser Funktion:

    AutoIt
    #include <Clipboard.au3>
    #include <GDIPlus.au3>
    #include <Memory.au3>
    
    
    _GDIPlus_Startup()
    Global $sFile = StringReplace(@AutoItExe, "autoit3.exe", "Examples\GUI\Torus.png")
    Global $hImage = _GDIPlus_ImageLoadFromFile($sFile)
    Global $aDim = _GDIPlus_ImageGetDimension($hImage)
    
    
    If _WinAPI_BitmapCopyToClipboard($hImage) Then
    	MsgBox(0, "Info", "Image copied to clipboard", 30)
    Else
    	MsgBox(16, "Error", "An error has occured: " & @error, 30)
    EndIf
    
    
    
    
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
    
    
    ; #FUNCTION# ====================================================================================================================
    ; Name ..........: _WinAPI_BitmapCopyToClipboard
    ; Description ...: Copies a GDIPlus bitmap to the clipboard
    ; Syntax ........: _WinAPI_BitmapCopyToClipboard($hImage)
    ; Parameters ....: $hImage              - a GDIPlus bitmap handle.
    ; Return values .: True on success otherwise False
    ; Author ........: UEZ
    ; Modified ......: 
    ; Remarks .......: It copies the color values from a GDIPlus bitmap to a device-independent bitmap (DIB) v5 32-bit to support
    ;				   transparent bitmaps.
    ; Version .......: 2017-08-15
    ; Example .......: No
    ; ===============================================================================================================================
    Func _WinAPI_BitmapCopyToClipboard($hImage)
    	If _ClipBoard_Open(0) Then
    		If _ClipBoard_Empty() Then
    			Local Const $iW = $aDim[0], $iH = $aDim[1]
    			Local $tBMPData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
    			If @error Then Return SetError(3, 0, False)
    			Local Const $iBmpSize = $iH * $tBMPData.Stride
    			Local $tBIV5HDR = DllStructCreate($tagBITMAPV5HEADER)
    			Local Const $iBuffLen = DllStructGetSize($tBIV5HDR) + $iBmpSize
    			Local $hMem = _MemGlobalAlloc($iBuffLen, $GHND)
    			Local Const $pDIBV5 = _MemGlobalLock($hMem)
    			$tBIV5HDR = DllStructCreate($tagBITMAPV5HEADER, $pDIBV5)
    			$tBIV5HDR.bV5Size = DllStructGetSize($tBIV5HDR)
    			$tBIV5HDR.bV5Width = $iW
    			$tBIV5HDR.bV5Height = $iH
    			$tBIV5HDR.bV5Planes = 1
    			$tBIV5HDR.bV5BitCount = 32
    			$tBIV5HDR.biCompression = $BI_BITFIELDS
    			$tBIV5HDR.bV5AlphaMask = 0xFF000000
    			$tBIV5HDR.bV5RedMask = 0x00FF0000
    			$tBIV5HDR.bV5GreenMask = 0x0000FF00
    			$tBIV5HDR.bV5BlueMask = 0x000000FF
    
    
    			Local $pBits, $iRowOffset, $iRowOffset2, $iX, $iY
    			Local Const $hBitmap = _WinAPI_CreateDIBSection(0, $tBIV5HDR, $DIB_RGB_COLORS, $pBits)
    
    
    			Local $tPixel = DllStructCreate("uint argb[" & $iW * $iH & "];", $tBMPData.Scan0)
    			Local $tBits = DllStructCreate("uint argb[" & $iW * $iH  & "]", $pBits)
    
    
    			For $iY = 0 To $iH - 1
    				$iRowOffset = $iY * $iW
    				$iRowOffset2 = ($iH - $iY + 1) * $iW
    				For $iX = 1 To $iW
    					$tBits.argb(($iRowOffset + $iX)) = $tPixel.argb(($iRowOffset2 + $iX))
    				Next
    			Next
    
    
    			_MemMoveMemory($pBits, $pDIBV5 + DLLStructGetSize($tBIV5HDR), $iBmpSize)
    
    
    			_ClipBoard_SetDataEx($hMem, $CF_DIBV5)
    
    
    			_GDIPlus_BitmapUnlockBits($hImage, $tBMPData)
    			_MemGlobalUnlock($pDIBV5)
    			_MemGlobalFree($hMem)
    			_WinAPI_DeleteObject($hBitmap)
    		Else
    			Return SetError(2, 0, False)
    		EndIf
    		_ClipBoard_Close()
    	Else
    		Return SetError(1, 0, False)
    	EndIf
    	Return True
    EndFunc
    Alles anzeigen

    Das Kopieren von größeren Bitmaps dauert länger, da AutoIt nicht schneller kopieren kann. Das riecht förmlich nach einem Inline ASM Boost (gelle Andy ^^ ).

    Das Bild wird mit XnView richtig dargestellt, mit IrfanView nicht. Andere Programme habe ich nicht getestet.

  • Kicktipp Bundesliga 2017/2018 Wetttippen! Jetzt mitmachen :)

    • UEZ
    • 11. August 2017 um 11:27

    Danke für die Anmeldungen! :thumbup:

    Es würde Sinn machen, wenn die Kicktipp User Namen dem des Forum entsprechen, da ich nicht weiß, wer die "fremden" User Namen sind. ;)

  • Kicktipp Bundesliga 2017/2018 Wetttippen! Jetzt mitmachen :)

    • UEZ
    • 4. August 2017 um 22:22

    Kostenlos und nur zum Spaß - einfach nur "just for fun".

  • Kicktipp Bundesliga 2017/2018 Wetttippen! Jetzt mitmachen :)

    • UEZ
    • 4. August 2017 um 20:31
    Zitat von Tweaky

    @UEZ
    Ist Rainer_Zufall auch wieder am Start?

    Diesmal ist "Raeiner Zufall" nicht dabei. ;)

  • Kicktipp Bundesliga 2017/2018 Wetttippen! Jetzt mitmachen :)

    • UEZ
    • 4. August 2017 um 16:53

    Bald fängt die neue Saison an und wer mitmachen möchte, einfach auf Kicktipp registrieren und unter https://www.kicktipp.de/autoit-bl Mitglied werden.

    Ich hoffe diesmal auf zahlreiche Teilnehmer.

    autoiter, Techmix und Tweaky sind mit übernommen, d.h. ihr benötigt keine Anmeldung, falls ihr wieder mittippen wollt.

    Am 18.08.2017 geht's los!

  • Starplayer v4

    • UEZ
    • 2. August 2017 um 22:44

    Keine Ahnung, woran das liegen könnte. Vielleicht gibt es eine Option "Trim Silence", um die Stille am Anfang / Ende zu entfernen.

    Vielleicht liegt's ja an VBR...

  • Starplayer v4

    • UEZ
    • 2. August 2017 um 16:47
    Zitat von Oscar

    Wie ermittele ich dann die Laufzeit?

    Du kannst mit den Funktionen

    • BASS_ChannelGetLength (liefert die Länge in Bytes)
    • BASS_ChannelBytes2Seconds (wandelt die Bytes in Sekunden um)

    die Zeit ermitteln.

  • Starplayer v4

    • UEZ
    • 2. August 2017 um 15:11

    Hallo Oscar,

    hier das Resultat einiger Tests:

    • wenn der ID3 Tag nicht gelesen werden kann, wird die Datei nicht hinzugefügt -> da würde ich den Dateiname nehmen
    • wenn ich eine Datei per DnD auf die GUI ziehe und Play drücke, wird die Liste geleert (Anzahl = 0, Dauer = 00:00:00)
    • einmal ist das Skript abgestürzt, als ich das Skript geschlossen habe, aber die Musik noch spielte
    • vor / zurück Spulen funktioniert nur, wenn man auf die Position klickt, aber nicht, wenn man den grauen Knopf verschieben will
  • Skript direkt mit der Beta Version von SciTE öffnen

    • UEZ
    • 23. Juli 2017 um 13:02

    Wenn du beide AutoIt Versionen installiert hast, kannst du mit dieser Direktive

    AutoIt
    #AutoIt3Wrapper_Version=b

    das Skript immer mit der Beta Version starten.

  • Mit GDI+ das Image beim Speichern überschreiben

    • UEZ
    • 21. Juli 2017 um 10:44

    Du musst die Exif Daten auslesen und sie in das neue Bild zurück schreiben.

    Vielleicht hilft dir dieser Link: https://www.autoitscript.com/forum/topic/82…ting-meta-data/

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™