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

Beiträge von bollen

  • RunWait: Angry IPscanner liefter Return Code direkt nach Start

    • bollen
    • 9. August 2013 um 17:06

    Bei mir funktioniert das wunderbar wenn ich ShellExecuteWait verwende

    [autoit]

    ShellExecuteWait ( "filename" [, "parameters" [, "workingdir" [, "verb" [, showflag]]]] )

    [/autoit]
  • OpenCV meets AutoIt

    • bollen
    • 18. Juli 2013 um 17:23

    ich hab das selbe Problem
    Bild:1920x1080x24BPP

    aber immerhin ist ein Muster dahinter, bei 97%;96% 92%;91% 87%;86% 82%;81% 77%;76% usw verschiebt es das Bild


    €: ca halb so großes Bild (1000x1000x24BPP) jetzt ist es alle 2% schräg

  • Bild mit 256 Farben erstellen

    • bollen
    • 11. April 2013 um 18:22

    Hallo Jolie,
    wilkommen im Forum.

    Du kannst ein Bild mit 256 Farben darstellen und speichern indem du es mit

    [autoit]

    _GDIPlus_BitmapCloneArea($hBmp,0, 0, $iWidth, $iHeight,$GDIP_PXF08INDEXED)

    [/autoit]


    clonst und dann mit

    [autoit]

    _GDIPlus_ImageSaveToFile

    [/autoit]

    abspeicherst

    Das $GDIP_PXF08INDEXED beschreibt die Farbtiefe also 8 Bit pro Pixel sind 256 Farben.
    2^8=256

    wenn du noch nicht so viel mit GDIPlus gearbeitet hast empfiehlt es sich erst einmal ein paar versuche zu machen und sich die Beispiele aus der Hilfe anzusehen

  • 8Bit Volladdierer

    • bollen
    • 9. April 2013 um 19:02

    ich habs mal so kurz wie möglich nur mit den bit Funktionen gemacht

    Spoiler anzeigen
    [autoit]

    Dim $i8bitB[8] = [0, 0, 0, 0, 0, 0, 0, 0], $i8bitA[8] = [0, 0, 0, 0, 0, 0, 0, 0]
    Global $iergebnis[8]; 0=1bit 1=2bit 2=3bit 3=4bit
    $iergebnis[0] = BitXOR(BitXOR($i8bitA[0], $i8bitB[0]), 0)
    $iergebnis[1] = BitXOR(BitXOR($i8bitA[1], $i8bitB[1]), BitOR(BitAND($i8bitA[0], $i8bitB[0]), BitAND(0, BitXOR($i8bitA[0], $i8bitB[0]))))
    $iergebnis[2] = BitXOR(BitXOR($i8bitA[2], $i8bitB[2]), BitOR(BitAND($i8bitA[1], $i8bitB[1]), BitAND(BitOR(BitAND($i8bitA[0], $i8bitB[0]), BitAND(0, BitXOR($i8bitA[0], $i8bitB[0]))), BitXOR($i8bitA[1], $i8bitB[1]))))
    $iergebnis[3] = BitXOR(BitXOR($i8bitA[3], $i8bitB[3]), BitOR(BitAND($i8bitA[2], $i8bitB[2]), BitAND(BitOR(BitAND($i8bitA[1], $i8bitB[1]), BitAND(BitOR(BitAND($i8bitA[0], $i8bitB[0]), BitAND(0, BitXOR($i8bitA[0], $i8bitB[0]))), BitXOR($i8bitA[1], $i8bitB[1]))), BitXOR($i8bitA[2], $i8bitB[2]))))
    $iergebnis[4] = BitXOR(BitXOR($i8bitA[4], $i8bitB[4]), BitOR(BitAND($i8bitA[3], $i8bitB[3]), BitAND(BitOR(BitAND($i8bitA[2], $i8bitB[2]), BitAND(BitOR(BitAND($i8bitA[1], $i8bitB[1]), BitAND(BitOR(BitAND($i8bitA[0], $i8bitB[0]), BitAND(0, BitXOR($i8bitA[0], $i8bitB[0]))), BitXOR($i8bitA[1], $i8bitB[1]))), BitXOR($i8bitA[2], $i8bitB[2]))), BitXOR($i8bitA[3], $i8bitB[3]))))
    $iergebnis[5] = BitXOR(BitXOR($i8bitA[5], $i8bitB[5]), BitOR(BitAND($i8bitA[4], $i8bitB[4]), BitAND(BitOR(BitAND($i8bitA[3], $i8bitB[3]), BitAND(BitOR(BitAND($i8bitA[2], $i8bitB[2]), BitAND(BitOR(BitAND($i8bitA[1], $i8bitB[1]), BitAND(BitOR(BitAND($i8bitA[0], $i8bitB[0]), BitAND(0, BitXOR($i8bitA[0], $i8bitB[0]))), BitXOR($i8bitA[1], $i8bitB[1]))), BitXOR($i8bitA[2], $i8bitB[2]))), BitXOR($i8bitA[3], $i8bitB[3]))), BitXOR($i8bitA[4], $i8bitB[4]))))
    $iergebnis[6] = BitXOR(BitXOR($i8bitA[6], $i8bitB[6]), BitOR(BitAND($i8bitA[5], $i8bitB[5]), BitAND(BitOR(BitAND($i8bitA[4], $i8bitB[4]), BitAND(BitOR(BitAND($i8bitA[3], $i8bitB[3]), BitAND(BitOR(BitAND($i8bitA[2], $i8bitB[2]), BitAND(BitOR(BitAND($i8bitA[1], $i8bitB[1]), BitAND(BitOR(BitAND($i8bitA[0], $i8bitB[0]), BitAND(0, BitXOR($i8bitA[0], $i8bitB[0]))), BitXOR($i8bitA[1], $i8bitB[1]))), BitXOR($i8bitA[2], $i8bitB[2]))), BitXOR($i8bitA[3], $i8bitB[3]))), BitXOR($i8bitA[4], $i8bitB[4]))), BitXOR($i8bitA[5], $i8bitB[5]))))
    $iergebnis[7] = BitXOR(BitXOR($i8bitA[7], $i8bitB[7]), BitOR(BitAND($i8bitA[6], $i8bitB[6]), BitAND(BitOR(BitAND($i8bitA[5], $i8bitB[5]), BitAND(BitOR(BitAND($i8bitA[4], $i8bitB[4]), BitAND(BitOR(BitAND($i8bitA[3], $i8bitB[3]), BitAND(BitOR(BitAND($i8bitA[2], $i8bitB[2]), BitAND(BitOR(BitAND($i8bitA[1], $i8bitB[1]), BitAND(BitOR(BitAND($i8bitA[0], $i8bitB[0]), BitAND(0, BitXOR($i8bitA[0], $i8bitB[0]))), BitXOR($i8bitA[1], $i8bitB[1]))), BitXOR($i8bitA[2], $i8bitB[2]))), BitXOR($i8bitA[3], $i8bitB[3]))), BitXOR($i8bitA[4], $i8bitB[4]))), BitXOR($i8bitA[5], $i8bitB[5]))), BitXOR($i8bitA[6], $i8bitB[6]))))
    MsgBox(0, "", $iergebnis[7] & $iergebnis[6] & $iergebnis[5] & $iergebnis[4] & $iergebnis[3] & $iergebnis[2] & $iergebnis[1] & $iergebnis[0])

    [/autoit]

    €: Namen angepasst
    €2: Noch kürzer und (vieleicht) verständlicher (480 Zeichen)

    Spoiler anzeigen
    [autoit]


    Dim $i8bitB[8] = [1, 0, 0, 0, 0, 0, 0, 0], $i8bitA[8] = [1, 1, 0, 0, 0, 0, 0, 0], $iergebnis[8]; 0=1bit 1=2bit 2=3bit 3=4bit
    Global $iuebertrag=0
    For $1=0 To 7
    $iergebnis[$1] = BitXOR(BitXOR($i8bitA[$1], $i8bitB[$1]), $iuebertrag)
    $iuebertrag=BitOR(BitAND($i8bitA[$1], $i8bitB[$1]), BitAND(BitXOR($i8bitA[$1], $i8bitB[$1]) ,$iuebertrag))
    Next
    MsgBox(0, "", $iergebnis[7] & $iergebnis[6] & $iergebnis[5] & $iergebnis[4] & $iergebnis[3] & $iergebnis[2] & $iergebnis[1] & $iergebnis[0])

    [/autoit]
  • Die Sache mit dem Alphakanal

    • bollen
    • 8. April 2013 um 20:43

    Speicher die Bilder doch einfach ohne Alpha Kanal wider ab ist zwar nicht perfekt, aber ein Anfang (sofern es Bilder mit Direktem Alphakanal sind). Die GDI Cracks haben bestimmt noch viel bessere lösungen die meinen Horizont leider um ein vielfaches übersteigen. Jedoch können sie auch nicht ohne ein beispiel oder zumindest deinem code arbeiten.

    Spoiler anzeigen

    Wenn ich mich nicht irre kann man so den Alpha Kanal entfernen :?: (pfusch lösung)

    [autoit]

    #include<gdiplus.au3>
    _GDIPlus_Startup()
    $hFile = FileOpenDialog("", "", "Images (*.jpg;*.bmp;*.png)")
    $hImage = _GDIPlus_BitmapCreateFromFile($hFile)
    $iX = _GDIPlus_ImageGetWidth($hImage)
    $iY = _GDIPlus_ImageGetHeight($hImage)
    $hClone = _GDIPlus_BitmapCloneArea($hImage, 0, 0, $iX, $iY, $GDIP_PXF32RGB)
    _GDIPlus_ImageSaveToFile($hClone, InputBox("" ,"Neuer Name" ,"")&".bmp")

    [/autoit]
  • Selektive Farbe bei Bildern - Verbessern und beschleunigen

    • bollen
    • 27. März 2013 um 21:17

    Mein Beitrag widmet sich nur der Geschwindigkeit und sollte nichts an der Qualität, weder positiv noch negativ , verändern.

  • Selektive Farbe bei Bildern - Verbessern und beschleunigen

    • bollen
    • 27. März 2013 um 18:37

    ich bin zwar kein Profi jedoch kannst du die Funktion _ArrayMaxIndex aus der Funktion _ColorInTolerance auslagern. Diese eine Änderung hat bei mir die Berechnungszeitzeit für ein 1024x768 Bild mit 24bit farbtiefe von 35,3s auf 19,6s gesenkt, wenn ich die exakt selbe Farbe angeklickt habe

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>
    #include <Color.au3>
    #include <WinAPI.au3>
    #include <Array.au3>
    Opt("GUIOnEventMode", 1)

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

    Global $sPath = FileOpenDialog("Choose Picture", @ScriptDir, "Pictures (*.bmp;*.jpg;*.png)", 1)
    If @error Then Exit

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

    Global $iCol = -1

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

    _GDIPlus_Startup()
    Global $hImage = _GDIPlus_ImageLoadFromFile($sPath)
    Global $iWidth = _GDIPlus_ImageGetWidth($hImage)
    Global $iHeight = _GDIPlus_ImageGetHeight($hImage)
    ;~ _GDIPlus_ImageGetPixelFormat
    _GDIPlus_ImageDispose($hImage)

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

    Global $hGui = GUICreate("Color effect - Click to choose color", $iWidth, $iHeight);, -1, -1, 0x80000000)
    Global $nPic = GUICtrlCreatePic($sPath, 0, 0, $iWidth, $iHeight)
    GUICtrlSetOnEvent(-1, "_GetColor")
    GUISetState(@SW_SHOW, $hGui)

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

    Do
    Until $iCol <> -1
    Opt("GUIOnEventMode", 0)

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

    WinSetTitle("Color effect", "", "Color effect - Please wait")

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

    Global $hBitmap = _GDIPlus_BitmapCreateFromFile($sPath)
    Global $tBitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $iWidth, $iHeight, $GDIP_ILMREAD + $GDIP_ILMWRITE, $GDIP_PXF32RGB)

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

    ;Stride - Offset, in bytes, between consecutive scan lines of the bitmap.
    ;If the stride is positive, the bitmap is top-down. If the stride is negative, the bitmap is bottom-up.
    Global $iStride = DllStructGetData($tBitmapData, "Stride")
    ;Pixel format - Integer that specifies the pixel format of the bitmap
    Global $iPixelFormat = DllStructGetData($tBitmapData, "Format")
    ;Scan0 - Pointer to the first (index 0) scan line of the bitmap.
    Global $pScan0 = DllStructGetData($tBitmapData, "Scan0")

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

    Global $tPixel

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

    Global $iColPixel, $aCol[3], $aSetCol = _ColorGetRGB($iCol) ,$maxindex=_ArrayMaxIndex($aSetCol);@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    Global $iTol = 80, $Luma
    $timer=TimerInit()
    For $row = 0 To $iHeight - 1

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

    For $col = 0 To $iWidth - 1
    $tPixel = DllStructCreate("dword", $pScan0 + $row * $iStride + $col * 4)
    $iColPixel = DllStructGetData($tPixel, 1)
    $aCol[0] = BitAND(BitShift($iColPixel, 16), 0xFF)
    $aCol[1] = BitAND(BitShift($iColPixel, 8), 0xFF)
    $aCol[2] = BitAND($iColPixel, 0xFF)
    If Not _ColorInTolerance($aSetCol, $aCol, $iTol ,$maxindex) Then ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    $Luma = $aCol[0] * 0.3 + $aCol[1] * 0.59 + $aCol[2] * 0.11
    DllStructSetData($tPixel, 1, BitOR($Luma, BitShift($Luma, -8), BitShift($Luma, -16)))
    EndIf
    Next

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

    Next
    MsgBox(0,"",TimerDiff($timer))
    _GDIPlus_BitmapUnlockBits($hBitmap, $tBitmapData)

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

    Global $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _WinAPI_DeleteObject(GUICtrlSendMsg($nPic, 370, 0, $hHBitmap))

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

    WinSetTitle("Color effect", "", "Color effect - Finished")

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

    Do
    Until GUIGetMsg() = -3

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

    Global $sFileName = FileSaveDialog("Save picture", @ScriptDir, "JPG mage (*.jpg)", 16, "Bitmap_" & Hex($iCol, 6) & ".JPG")
    If Not @error Then
    If StringRight($sFileName, 4) <> ".JPG" Then $sFileName &= ".JPG"
    Global $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap)
    _GDIPlus_ImageSaveToFile($hImage, $sFileName)
    _WinAPI_DeleteObject($hImage)
    EndIf

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

    _WinAPI_DeleteObject($hBitmap)
    _WinAPI_DeleteObject($hHBitmap)
    _GDIPlus_Shutdown()

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

    Func _ColorInTolerance($aSetCol, $aCol, $iTol ,$maxindex) ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    Global $aTol[3] = [$iTol, $iTol, $iTol] ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    $aTol[$maxindex] = $iTol
    If ($aSetCol[0] - $aTol[0]) < $aCol[0] And ($aSetCol[0] + $aTol[0]) > $aCol[0] And _
    ($aSetCol[1] - $aTol[1]) < $aCol[1] And ($aSetCol[1] + $aTol[1]) > $aCol[1] And _
    ($aSetCol[2] - $aTol[2]) < $aCol[2] And ($aSetCol[2] + $aTol[2]) > $aCol[2] Then
    Return 1
    Else
    Return 0
    EndIf
    EndFunc ;==>_ColorInTolerance

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

    Func _GetColor()
    $iCol = PixelGetColor(MouseGetPos(0), MouseGetPos(1))
    EndFunc ;==>_GetColor

    [/autoit]

    €: sehr schöner code und ein sehr gutes Ergebnis

    €2: bei etwas genauerer betrachtung kannst du die funktion _ColorInTolerance auf

    [autoit]

    Func _ColorInTolerance($aSetCol, $aCol, $iTol)
    If ($aSetCol[0] - $iTol) < $aCol[0] And ($aSetCol[0] + $iTol) > $aCol[0] And _
    ($aSetCol[1] - $iTol) < $aCol[1] And ($aSetCol[1] + $iTol) > $aCol[1] And _
    ($aSetCol[2] - $iTol) < $aCol[2] And ($aSetCol[2] + $iTol) > $aCol[2] Then
    Return 1
    EndIf
    EndFunc ;==>_ColorInTolerance

    [/autoit]


    kürzen, oder übersehe ich etwas (16 sekunden)

  • Hilfe - Verzweifle mit der Zwischenablage

    • bollen
    • 27. März 2013 um 18:00

    Ich hab leider kein Microsoft Navision, aber kann man das Feld nicht mit

    [autoit]

    ControlGetText ( "title", "text", controlID )

    [/autoit]

    auslesen?
    das würde die sache wesentlich einfacher machen und ohne Send() befehl auskommen

    Spoiler anzeigen
    [autoit]

    MouseClick("left", 104, 100, 1, 1); Wir wechseln auf den Reiter Fakturierung
    ClipPut(""); Zwischenablage wird geleert
    Sleep($varSleep); Warte X Millisekunden - aktuell ca. 350

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

    $text=ControlGetText("title" ,"text" , controlID)
    ClipPut($text)

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

    Local $bak = ClipGet(); Lese die Zwischenablage
    MsgBox(0, "Clipboard contains:", $bak); Gebe den Inhalt der Zwischenablage in einer Messagebox aus
    _Stop()

    [/autoit]
  • suche schnelle Routine um einen großen String verschlüsseln

    • bollen
    • 26. März 2013 um 18:45

    ich würde

    [autoit]

    _Crypt_DecryptData($vData, $vCryptKey, $iALG_ID [, $fFinal = True])

    [/autoit]


    verwenden damit Verschlüssele ich eine 2,6 MB Datei in unter 50ms

    mit der Funktion

    [autoit]

    _Crypt_EncryptData($vData, $vCryptKey, $iALG_ID [, $fFinal = True])

    [/autoit]


    kannst du dann dein verschlüsselten Text wider entschlüsseln. Natürlich nur wen du das gleiche Passwort verwendest.

    Hier ist noch mein versuchsscript. Eine abwandlung aus dem Beispielsscript in der Hilfe.

    Spoiler anzeigen
    [autoit]


    #include <Crypt.au3>

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

    Local Const $sUserKey = "CryptPassword" ; Declare a password string to decrypt/encrypt the data.
    Local $sData = FileRead(FileOpenDialog("" ,"" ,""))

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

    $timer=TimerInit()
    $bEncrypted = _Crypt_DecryptData($sData, $sUserKey, $CALG_RC4) ; Decrypt the data using the generic password string. The return value is a binary string.
    MsgBox(0,@error,TimerDiff($timer))
    FileWrite("Decrypted File.txt" , BinaryToString($bEncrypted)) ; Convert the binary string using BinaryToString to display the initial data we encrypted.

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

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™