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

  • C++ oder Java?

    • UEZ
    • 23. März 2011 um 20:41

    Java hat einen Vorteil gegenüber C++: es ist Plattform unabhängig, wobei Java ähnliche Syntax hat wie C++.

    Ich versuche auch seit einigen Jahren mit C++ anzufangen, aber mir fehlt noch der Einstieg, zumal ich mich an AutoIt sehr gewöhnt habe und keine zeitkritischen Anwendungen schreiben muss.

    Viel Spaß mit C++.

    Selam,
    UEZ

  • Write Text on Bitmap v0.92 Build 2013-02-16 Beta

    • UEZ
    • 23. März 2011 um 10:58

    Hier eine UDF zum Beschreiben von Bitmaps.

    Die Idee stammt von hier: SaveBitmap.

    [autoit]

    #include-once
    #include <GDIPlus.au3>
    Opt('MustDeclareVars', 1)
    ;======================================================================================
    ; Function Name: _GDIPlus_WTOB (Write Text On Bitmap)
    ; Description:Loads a bitmap and writes a text on it
    ;
    ; Parameters: $sIn:filename of the bitmap or a handle to a bitmap
    ; $sText:the text which will be written onto the bitmap centered
    ; Optional:
    ; $fName:font name to be used
    ; $fSize:fonst size of the text
    ;$iX:x position of font - if x and y set $iAlignX and $iAlignY will be skipped
    ;$iY:y position of font
    ;$iAlignX:align the font center, left, right (0, 1, 2) on x axis
    ;$iAlignY:align the font center, top, buttom (0, 1, 2) on y axis
    ;$iFColor:color of font
    ;$ebg:enable background black painting to get contrast with font color
    ; $save:if set to 1 bitmap will be saved
    ; $sFilename:filename of the save bitmap, if no extension is given PNG will be used instead
    ; $iJPGQ:jpg image save quality -> 0: worst, 100: best
    ;$draw_bgrect draws a filled transparent rectangle to make the font better readable
    ;$iDrawBGRect_c color of filled transparent rectangle
    ;
    ; Error codes:
    ;1: image file not found
    ;2: no text given
    ;3: no font given
    ;4: wrong font size - must be greater then 0
    ;5: wrong align x value
    ;6: wrong align y value
    ;7: unable to create bitmap from scan 0
    ;8: unable to save image
    ;
    ; Requirement(s):GDIplus.au3
    ; Return Value(s): Success: handle to bitmap, Error: 0
    ; Author(s):UEZ
    ; Version:v0.92 Build 2013-02-16 Beta
    ;=======================================================================================
    Func _GDIPlus_WTOB($sIn, $sText, $fName = "Impact", $fSize = 11, $iX = -1, $iY = -1, $iAlignX = 2, $iAlignY = 2, $iFColor = 0xFFFFFFFF, $ebg = True, $save = False, $sFilename = "WTOB.png", $iJPGQ = 90, $draw_bgrect = False, $iDrawBGRect_c = 0xFF808080)
    Local $handle = False, $hImage, $declared = True
    If IsPtr($sIn) Then $handle = True
    If (Not $handle) And ($sIn = "" Or Not FileExists($sIn)) Then Return SetError(1, 0, "File not found")
    If $sText = "" Then Return SetError(2, 0, "No text given")
    If $fName = "" Then SetError(3, 0, "No font given")
    If Not IsInt($fSize) And $fSize > 0 Then Return SetError(4, 0, "Wrong font size")
    If $iAlignX < 0 Or $iAlignX > 2 Then Return SetError(5, 0, "Wrong align x value")
    If $iAlignY < 0 Or $iAlignY > 2 Then Return SetError(6, 0, "Wrong align y value")

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

    If Not $__g_hGDIPDll Then
    _GDIPlus_Startup()
    $declared = False
    EndIf

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

    If Not $handle Then
    $hImage = _GDIPlus_ImageLoadFromFile($sIn)
    Else
    $hImage = $sIn
    EndIf
    Local $iW = _GDIPlus_ImageGetWidth($hImage)
    Local $iH = _GDIPlus_ImageGetHeight($hImage)

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

    Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH)
    If @error Then Return SetError(7, @extended, "Unable to create bitmap from scan 0")
    Local $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hContext, 2)
    DllCall($__g_hGDIPDll, "int", "GdipSetInterpolationMode", "handle", $hContext, "int", 7)
    DllCall($__g_hGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $hContext, "int", 4)

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

    Local $hPinsel = _GDIPlus_BrushCreateSolid($iFColor)
    Local $hFormat = _GDIPlus_StringFormatCreate()
    Local $hFamily = _GDIPlus_FontFamilyCreate($fName)
    ;~ Local $font_size = Floor(($iW - StringLen($sText)) / $fSize)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $fSize, 1)
    Local $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0)
    Local $aInfo = _GDIPlus_GraphicsMeasureString($hContext, $sText, $hFont, $tLayout, $hFormat)

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

    _GDIPlus_GraphicsDrawImageRect($hContext, $hImage, 0, 0, $iW, $iH)

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

    Local $fWidth = DllStructGetData($aInfo[0], "Width")
    Local $fHeight = DllStructGetData($aInfo[0], "Height")

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

    If $iX < 0 Then
    Switch $iAlignX
    Case 0 ;alignment center
    DllStructSetData($tLayout, "x", $iW / 2 - Round($fWidth / 2, 0))
    Case 1 ;alignment left
    DllStructSetData($tLayout, "x", 0)
    Case 2 ;alignment right
    DllStructSetData($tLayout, "x", $iW - $fWidth - 1)
    EndSwitch
    Else
    DllStructSetData($tLayout, "x", $iX)
    EndIf

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

    If $iY < 0 Then
    Switch $iAlignY
    Case 0 ;alignment center
    DllStructSetData($tLayout, "y", $iH / 2 - Floor($fHeight / 2))
    Case 1 ;alignment top
    DllStructSetData($tLayout, "y", 0)
    Case 2 ;alignment buttom
    DllStructSetData($tLayout, "y", $iH - $fHeight - 1)
    EndSwitch
    Else
    DllStructSetData($tLayout, "y", $iY)
    EndIf

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

    Local $hBrush_rect = _GDIPlus_BrushCreateSolid($iDrawBGRect_c)
    If $draw_bgrect Then _GDIPlus_GraphicsFillRect($hContext, DllStructGetData($tLayout, "x"), DllStructGetData($tLayout, "y"), $fWidth, $fHeight, $hBrush_rect)

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

    Local $i, $fs = $fSize * 0.075
    Local $hBrush_back = _GDIPlus_CreateLineBrush(0, 0, 0, $fSize, 0xFF000000, 0xFF808080)
    Local $tLayout2 = _GDIPlus_RectFCreate(0, 0, 0, 0)
    DllStructSetData($tLayout2, "Width", $fWidth)
    DllStructSetData($tLayout2, "Height", $fHeight)
    If $ebg Then
    For $i = 0 To 3
    Switch $i
    Case 0
    DllStructSetData($tLayout2, "x", DllStructGetData($tLayout, "x"))
    DllStructSetData($tLayout2, "y", DllStructGetData($tLayout, "y") - $fs)
    Case 1
    DllStructSetData($tLayout2, "x", DllStructGetData($tLayout, "x") + $fs)
    DllStructSetData($tLayout2, "y", DllStructGetData($tLayout, "y"))
    Case 2
    DllStructSetData($tLayout2, "x", DllStructGetData($tLayout, "x"))
    DllStructSetData($tLayout2, "y", DllStructGetData($tLayout, "y") + $fs)
    Case 3
    DllStructSetData($tLayout2, "x", DllStructGetData($tLayout, "x") - $fs)
    DllStructSetData($tLayout2, "y", DllStructGetData($tLayout, "y"))
    EndSwitch
    _GDIPlus_GraphicsDrawStringEx($hContext, $sText, $hFont, $tLayout2, $hFormat, $hBrush_back)
    Next
    EndIf
    _GDIPlus_GraphicsDrawStringEx($hContext, $sText, $hFont, $tLayout, $hFormat, $hPinsel)

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

    _GDIPlus_ImageDispose($hImage)
    Local $err = 0
    If $save Then
    If StringRight($sFilename, 4) = ".jpg" Then
    Local $sCLSID = _GDIPlus_EncodersGetCLSID("JPG")
    Local $tParams = _GDIPlus_ParamInit(1)
    Local $tData = DllStructCreate("int Quality")
    DllStructSetData($tData, "Quality", $iJPGQ) ;quality 0-100
    Local $pData = DllStructGetPtr($tData)
    _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData)
    Local $pParams = DllStructGetPtr($tParams)
    If Not _GDIPlus_ImageSaveToFileEx($hBitmap, $sFilename, $sCLSID, $pParams) Then $err = 8
    $tParams = 0
    $tData = 0
    Else
    If StringMid($sFilename, StringLen($sFilename) - 3, 1) <> "." Then $sFilename &= ".png"
    If Not _GDIPlus_ImageSaveToFile($hBitmap, $sFilename) Then $err = 8
    EndIf
    EndIf
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($hPinsel)
    _GDIPlus_BrushDispose($hBrush_rect)
    _GDIPlus_BrushDispose($hBrush_back)
    _GDIPlus_GraphicsDispose($hContext)
    If Not $declared Then _GDIPlus_Shutdown()
    $tLayout = 0
    $tLayout2 = 0
    Return SetError($err, 0, $hBitmap)
    EndFunc ;==>WTOB

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

    Func _GDIPlus_CreateLineBrush($iPoint1X, $iPoint1Y, $iPoint2X, $iPoint2Y, $iArgb1 = 0xFF0000FF, $iArgb2 = 0xFFFF0000, $WrapMode = 1)
    Local $tPoint1, $pPoint1, $tPoint2, $pPoint2, $aRet
    If $iArgb1 = "" Then $iArgb1 = 0xFF0000FF
    If $iArgb2 = "" Then $iArgb2 = 0xFFFF0000
    If $WrapMode = -1 Then $WrapMode = 0
    $tPoint1 = DllStructCreate("float X;float Y")
    $pPoint1 = DllStructGetPtr($tPoint1)
    DllStructSetData($tPoint1, "X", $iPoint1X)
    DllStructSetData($tPoint1, "Y", $iPoint1Y)
    $tPoint2 = DllStructCreate("float X;float Y")
    $pPoint2 = DllStructGetPtr($tPoint2)
    DllStructSetData($tPoint2, "X", $iPoint2X)
    DllStructSetData($tPoint2, "Y", $iPoint2Y)
    $aRet = DllCall($__g_hGDIPDll, "int", "GdipCreateLineBrush", "ptr", $pPoint1, "ptr", $pPoint2, "int", $iArgb1, "int", $iArgb2, "int", $WrapMode, "int*", 0)
    Return $aRet[6]
    EndFunc ;==>_GDIPlus_CreateLineBrush

    [/autoit]

    Gruß,
    UEZ

    Dateien

    _GDIPlus_WTOB (Write Text on Bitmap) v0.92 Build 2013-02-16 Beta.7z 55,85 kB – 358 Downloads
  • unrar.exe commandlinetool Prozentwert auslesen

    • UEZ
    • 22. März 2011 um 20:11

    Hier ein Tool von Valik, wie man für 7-Zip die Prozente auslesen kann -> http://www.autoitscript.com/forum/topic/71…__1#entry527810

    Vielleicht kann man das auch für unrar.exe umsetzen oder du verwendest 7-Zip für das Entpacken.

    Gruß,
    UEZ

  • Ascii in au3

    • UEZ
    • 22. März 2011 um 11:10

    Probiere es mal mit ChrW():

    [autoit]


    #include <GUIConstantsEx.au3>
    $hGUI = GUICreate("Test", 320, 256)
    $label = GUICtrlCreateLabel("Test â–º " & ChrW(8658), 100, 100)
    GUISetState()

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

    While True
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

    [/autoit]

    Gruß,
    UEZ

  • Computer-Info

    • UEZ
    • 21. März 2011 um 17:32

    Probiert mal dies:

    Spoiler anzeigen
    [autoit]


    If @OSArch = "X86" Then
    $DigitalProductId = RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\", "DigitalProductId")
    Else
    $DigitalProductId = RegRead("HKLM64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\", "DigitalProductId")
    EndIf

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

    MsgBox(0, "Decode Product Key", _DecodeProductKey($DigitalProductId))

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

    Func _DecodeProductKey($BinaryDPID)
    Local $bKey[15]
    Local $sKey[29]
    Local $Digits[24]
    Local $Value = 0
    Local $hi = 0
    Local $n = 0
    Local $i = 0
    Local $dlen = 29
    Local $slen = 15
    Local $Result

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

    $Digits = StringSplit("BCDFGHJKMPQRTVWXY2346789", "")

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

    $BinaryDPID = StringMid($BinaryDPID, 107, 30)

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

    For $i = 1 To 29 Step 2
    $bKey[Int($i / 2)] = Dec(StringMid($BinaryDPID, $i, 2))
    Next

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

    For $i = $dlen - 1 To 0 Step -1
    If Mod(($i + 1), 6) = 0 Then
    $sKey[$i] = "-"
    Else
    $hi = 0
    For $n = $slen - 1 To 0 Step -1
    $Value = BitOR(BitShift($hi, -8), $bKey[$n])
    $bKey[$n] = Int($Value / 24)
    $hi = Mod($Value, 24)
    Next
    $sKey[$i] = $Digits[$hi + 1]
    EndIf

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

    Next
    For $i = 0 To 28
    $Result = $Result & $sKey[$i]
    Next

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

    Return $Result
    EndFunc ;==>DecodeProductKey

    [/autoit]

    Gruß,
    UEZ

  • Screenshot von Web Seiten

    • UEZ
    • 18. März 2011 um 13:05
    Zitat von andygo

    und gleich noch eine frage im anschluss: könnte man den code auch so verändern das wenn eine seite > 8192 ist, erst von 0 bis 8192 ge-screent wird, zwischengelagert, dann von 8192 bis ende (bzw. bis 16.384)... u.s.w. und dann die teile per gdi+ zusammenfügt zu einem bild?

    Sowas ähnliches hat Eukalyptus bereits gemacht (siehe Post#10). Aber ich werde es auch mal bei Gelegenheit probieren..


    Warum das Limit bei 8192 = 2^13 = 0x2000 = 10000000000000 ist, weiß wohl MS am besten. Ich bin mal gespannt, was es noch für Probleme mit den IE Funktionen in AutoIt bzgl. IE9 geben wird.

    Gruß,
    UEZ

  • Screenshot von Web Seiten

    • UEZ
    • 18. März 2011 um 11:41

    Hmmm, warum plötzlich die Beschränkung auf 8192? ?(

    Aber egal, jetzt weiß ich es ja :D

    Danke andygo!


    Habe den Code aktualisiert.


    Gruß,
    UEZ

  • Screenshot von Web Seiten

    • UEZ
    • 18. März 2011 um 10:07

    Ich habe vorgestern IE9 installiert und nun wird z.B. https://autoit.de/www.stern.de nur weiß gerendert, wobei beim ersten Rendern die Seite noch angezeigt wird.

    Beim ersten Rendern wird die Höhe des Fensters ermittelt, die dann beim zweiten Rendern benutzt wird, um den Screenshot von der Webseite zu erstellen.

    Hat jemand eine Idee, warum das jetzt so ist bzw. kann jemand das mal testen (mit IE9 und Aero!), ob das Fenster auch weiß bleibt? Der Screenshot wird in den Clipboard geschickt.

    Der Code ist im ersten Post!

    Gruß,
    UEZ

  • Scaneffekt Bild

    • UEZ
    • 16. März 2011 um 14:16

    Hatte ich vergessen zu posten:

    Spoiler anzeigen
    [autoit]


    ;coded by UEZ 2011-03-16
    #include <GDIPlus.au3>
    Opt("GUIOnEventMode", 1)

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

    _GDIPlus_Startup ()
    $hImage = _GDIPlus_ImageLoadFromFile("..\..\Images\earth_small2.bmp")
    If Not $hImage Then
    _GDIPlus_Shutdown()
    Exit
    EndIf
    $iW = _GDIPlus_ImageGetWidth($hImage)
    $iH = _GDIPlus_ImageGetHeight($hImage)
    $hGUI = GUICreate("GDI+ Test", $iW, $iH)
    GUISetState()

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

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphic)
    $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    $hBrush = _GDIPlus_BrushCreateSolid(0)

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

    $b = 1 + Floor($iW / 5)
    $x = -$b

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

    $hScannerBitmap = _GDIPlus_BitmapCreateFromGraphics($b, $iH, $hGraphic)
    $hContext = _GDIPlus_ImageGetGraphicsContext($hScannerBitmap)
    $alpha_start = 0x04
    $alpha_end = 0xD0
    $alpha_steps = ($alpha_end - $alpha_start) / $b
    $alpha = $alpha_start

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

    For $i = 0 To $b
    $alpha += $alpha_steps
    _GDIPlus_BrushSetSolidColor($hBrush, "0x" & Hex($alpha, 2) & "00FF00")
    _GDIPlus_GraphicsFillRect($hContext, $i, 0, 1, $iH, $hBrush)
    Next
    GUISetOnEvent(-3, "_Exit")

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

    While Sleep(20)
    If Mod($x + $b, 30) < 15 Then
    WinSetTitle($hGUI, "", "Scanning ...")
    Else
    WinSetTitle($hGUI, "", "")
    EndIf
    _GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hImage, 0, 0, $iW, $iH)
    _GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hScannerBitmap, $x, 0, $b, $iH)
    $x += 1
    If $x > $iW + $b Then $x = -$b
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iW, $iH)
    WEnd

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

    Func _Exit()
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_BitmapDispose ($hScannerBitmap)
    _GDIPlus_BitmapDispose ($hBitmap)
    _GDIPlus_GraphicsDispose($hContext)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Bälle die von Wänden und Gegenständen abprallen

    • UEZ
    • 15. März 2011 um 16:22

    Schaue dir doch mal die Physik Engine2 von Moritz1243 an!

    Gruß,
    UEZ

  • In Datei Werte suchen und ändern ( Hex Datei )

    • UEZ
    • 14. März 2011 um 23:43

    Vielleicht mein progandy sowas:

    Spoiler anzeigen
    [autoit]


    #include <FileConstants.au3>
    #include <Array.au3>

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

    $run = FileBinReplace("ap.txt", "3030", "7878") ;suche nach Hex 3030 und ersetze es mit Hex 7878 -> 00->xx
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $run = ' & $run & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console

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

    Func FileBinReplace($filename, $search, $replace) ;coded by UEZ build 2011-03-15 ßeta
    If $filename = "" Then Return SetError(1, 0, 0)
    If Not FileExists($filename) Then Return SetError(2, 0, 0)
    If $search = "" Or $replace = "" Then Return SetError(3, 0, 0)
    Local $data
    If Mod(StringLen($search), 2) = 1 Then $search = "0" & $search
    If Mod(StringLen($replace), 2) = 1 Then $replace = "0" & $replace
    If StringLen($search) <> StringLen($replace) Then Return SetError(4, 0, 0)
    Local $aTokens = StringRegExp($search, ".{2}", 3)
    If Not IsArray($aTokens) Then Return SetError(5, 0, 0)
    Local $len = UBound($aTokens)
    Local $flen = FileGetSize($filename)
    If @error Or $flen = 0 Then Return SetError(6, 0, 0)
    Local $hFile = FileOpen($filename, 16 + 1)
    If @error Then Return SetError(7, 0, 0)
    Local $pos = 0, $i = 0, $old_pos = 0, $c = 0
    While $pos < $flen + 1
    $old_pos = $pos
    While $i < $len
    FileSetPos($hFile, $pos, $FILE_BEGIN)
    If "0x" & $aTokens[$i] <> FileRead($hFile, 1) Then ExitLoop
    $pos += 1
    $i += 1
    WEnd
    If $i = $len Then
    FileSetPos($hFile, $old_pos, $FILE_BEGIN)
    FileWrite($hFile, "0x" & $replace)
    $pos += $len - $i
    $c += 1
    Else
    $pos += 1
    EndIf
    $i = 0
    WEnd
    FileFlush($hFile)
    FileClose($hFile)
    Return SetError(0, 0, $c)
    EndFunc

    [/autoit]

    Keine Ahnung, ob das schneller oder besser ist - ist einfach nur ein Konzept Code.

    Gruß,
    UEZ

  • Funktionen der Skripte im Includeverzeichnis anzeigen

    • UEZ
    • 13. März 2011 um 14:33

    Genau so, aber die Funktion zur Bestimmung des Include Verzeichnisses ist nicht ganz richtig:

    [autoit]


    ; Fabian -> http://www.autoit.de/index.php?page…1763#post211763
    ;~ If Not @Compiled Then
    ;~ If @OSArch = "x86" Then
    ;~ $StdDir = StringReplace(@AutoItExe, "autoit3.exe", "Include")
    ;~ Else
    ;~ $StdDir = StringReplace(@AutoItExe, "autoit3_x64.exe", "Include")
    ;~ EndIf
    ;~ Else
    If @OSArch = "x86" Then
    $StdDir = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") & "\Include"
    Else
    $StdDir = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\AutoIt v3\AutoIt", "InstallDir") & "\Include"
    EndIf
    ;~ EndIf

    [/autoit]

    Wie auch von Raupi erwähnt. ;)

    Gruß,
    UEZ

  • Funktionen der Skripte im Includeverzeichnis anzeigen

    • UEZ
    • 12. März 2011 um 20:28
    Zitat von Großvater

    Hallo UEZ,

    das Folders Menü habe ich eigentlich nur für die Anzeige der Zuordnung der Ziffern in der Scripts-DDL zu den Verzeichnisnamen eingebaut und es dann auch dringelassen. Deshalb sind die Menüeinträge disabled.

    Wenn Interesse daran besteht, sie mit Leben in Form von aus/abwählen zu erfüllen, könnte ich das noch nachholen.

    Das Problem ist, dass das Include Verzeichnis von AutoIt und mein Persönliches angezeigt wird und ich kann nicht zwischen diesen umschalten. Es wird nur 2> angezeigt.

    Gruß,
    UEZ

  • GDI+ - Bild von Graphic speichern & vergrößern ohne Smoothing

    • UEZ
    • 12. März 2011 um 14:59
    Zitat von Mattthias


    Hallo Leute,

    1. ich habe ein Bild aus einer Datei geladen und zeichne es mithilfe von GDI+ auf eine Graphic.
    Jetzt möchte ich dieses Bild speichern, nur wie ziehe ich es von der Graphic ?


    Von der Graphic direkt geht es nicht. Du musst das Bild z.B. über den Doppeltbuffer schieben, damit du das Bild von der Bitmap "abziehen" kannst!

    [autoit]


    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphic)
    $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)

    [/autoit]

    Mit _GDIPlus_ImageSaveToFile($hBitmap, $sFileName) kannst du das Bild entsprechend abspeichern.


    Zitat von Mattthias


    2. Möchte ich ein Bild vergrößer so wird dieses "gesmootht" (richtig geschrieben ?), mit dem Smoothing Befehl der _GDIPlus UDF funktioniert das abschalten allerdings nicht, ich entsinne mich dass diese Frage schon einmal gestellt und beantwortet wurde, finde den thread aber nicht mehr


    Danke für eure Hilfe, MfG

    Da kannst du die _GDIPlus_GraphicsSetInterpolationMode() Funktion dazu benutzen (Wert 5), damit das vergrößerte Bild nicht geglättet wird.

    [autoit]


    Func _GDIPlus_GraphicsSetInterpolationMode($hGraphics, $iInterpolationMode)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "hwnd", $hGraphics, "int", $iInterpolationMode)
    If @error Then Return SetError(@error, @extended, False)
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_GraphicsSetInterpolationMode

    [/autoit]

    Gruß,
    UEZ

  • Funktionen der Skripte im Includeverzeichnis anzeigen

    • UEZ
    • 12. März 2011 um 11:58

    Gute Idee Großvater :thumbup:

    Wie kann ich unter "Folders" die Einträge wechseln? Ich habe 2 Einträge, Eintrag 2 ist selektiert und die Einträge sind standardmäßig "disabled".

    Gruß,
    UEZ

  • AssembleIt incl. Laufzeit-"Debugger" [Update12/04/2012]

    • UEZ
    • 12. März 2011 um 00:57

    Feine Sache Andy! :thumbup:

    Ich hab' da was, was ich nach ASM portieren will.... :D

    Gruß,
    UEZ

  • Transparenz bei mehreren Bildern

    • UEZ
    • 9. März 2011 um 11:44

    Probiere es mal damit:

    [autoit]


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

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

    $hGUI = GUICreate("Test", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
    GUISetBkColor(0x000000)
    GUICtrlCreatePic("GUI.gif",0,0,989,768)

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

    $Label = GUICtrlCreateLabel(ChrW(9608),225,112,715,8)
    GUICtrlSetBkColor($Label, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont($Label, 1, 400, 0, "Fixedsys")
    GUICtrlSetColor($Label, 0xFF0000)

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

    $hGUI2 = GUICreate("", 599, 386, 150, 230, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_LAYERED, $hGUI)
    GUICtrlCreatePic("24852.gif", 0, 0, 599, 386)

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

    GUISetState (@SW_SHOW, $hGUI)
    GUISetState (@SW_SHOW, $hGUI2)

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

    While 1
    $Progress = GUICtrlRead($Label)
    GUICtrlSetData($Label, $Progress & ChrW(9608))
    If StringLen($Progress) > 87 Then
    Sleep(2000)
    ExitLoop
    EndIf
    Sleep(100)
    WEnd

    [/autoit]

    Der Balken sieht unter Win7 anders aus (keine Striche) und flimmert. Unter WinXP flimmert nichts.

    Gruß,
    UEZ

  • Head - Tail v0.65 Build 2011-03-15 Beta

    • UEZ
    • 6. März 2011 um 17:18

    Hallo Großvater,

    vielen Dank für deine Version. Momentan liege ich wegen einer Grippe im Bett und werde deine Version sobald wie möglich testen, ob ich die Logfiles, die von Robocopy erstellt und beschrieben werden, während der Laufzeit anzeigen kann.

    Die WindowsUpdate.log wird schon mal angezeigt, nach dem ich wuauclt /detectnow gestartet habe.

    Bis denne,
    UEZ

  • GDI+ Text jede Sekunde neu zeichnen

    • UEZ
    • 3. März 2011 um 16:26

    Ich habe auch mal meine Uhr aktualisiert:

    [ offen ] Gdi plus

    Gruß,
    UEZ

  • Textdatei einlesen und als binary speichern.

    • UEZ
    • 3. März 2011 um 15:45

    Probiere es mal damit:

    [autoit]


    $sData = FileRead(@ScriptDir & "\test.txt")
    $newData = "0x" & StringStripCR(StringReplace(StringRegExpReplace($sData, "(?m).{9}(.*).{1}\w", "$1"), Chr(10), ""))
    $hFile = FileOpen(@ScriptDir & "\test.bin", 18)
    FileWrite($hFile, $newData)
    FileClose($hFile)

    [/autoit]

    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™