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

  • Zahl in 3 kleinere aufteilen nach System

    • UEZ
    • 31. Januar 2012 um 19:53

    Hier meine Brute Force Methode:

    Spoiler anzeigen
    [autoit]


    Global $aZahlen[53], $i, $j
    $aZahlen[0] = 0
    $j = 1
    For $i = 65 To 90
    $aZahlen[$j] = $i
    $j += 1
    Next
    For $i = 97 To 122
    $aZahlen[$j] = $i
    $j += 1
    Next

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

    ConsoleWrite(AQSumme(226, $aZahlen) & @LF)
    ConsoleWrite(AQSumme(333, $aZahlen) & @LF)
    ConsoleWrite(AQSumme(178, $aZahlen) & @LF)

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

    Func AQSumme($zahl, $array) ;Brute Force
    Local $summe, $ub = UBound($array)
    Local $i = 0, $j = 0, $k = 0
    Local $a, $b, $c, $z
    While $summe <> $zahl
    $a = $array[$i]
    $b = $array[$j]
    $c = $array[$k]
    $summe = $a + $b + $c
    If $k = $ub - 1 Then $j += 1
    If $j = $ub - 1 Then $i += 1
    If $i = $ub - 1 Then Return 0
    $z += 1
    $k = Mod($z, $ub)
    WEnd
    Return $a & "+" & $b & "+" & $c & "=" & $summe ;& " / " & Chr($a) & "+" & Chr($b) & "+" & Chr($c)
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • PNG ohne Rahmen darstellen

    • UEZ
    • 22. Januar 2012 um 20:56

    Das Bild wieder laden und in den Grafik Handle kopieren.

    Vorher das alte Handle "disposen".

    Gruß,
    UEZ

  • PNG ohne Rahmen darstellen

    • UEZ
    • 21. Januar 2012 um 18:26

    Ersetze die _Redraw() Funktion mit dieser:

    [autoit]


    Func _Redraw()
    _GDIPlus_GraphicsClear($hGraphic1, 0xFF232A30)
    _GDIPlus_GraphicsDrawImageRect($hGraphic1, $hImage, 615, 545, 400, 240)
    Return 1
    EndFunc ;==>_redraw

    [/autoit]

    Gruß,
    UEZ

  • PNG ohne Rahmen darstellen

    • UEZ
    • 20. Januar 2012 um 19:53

    Hier mal 2 Beispiele wie oben beschrieben.

    Beispiel 1 (GDI+):

    Spoiler anzeigen
    [autoit]


    #AutoIt3Wrapper_UseUpx=n
    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>

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

    Opt("GUIOnEventMode", 1)
    Opt('MustDeclareVars', 1)

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

    Local $iX = 320
    Local $iY = 320
    Local $hWnd = GUICreate("GDI+ Redraw Window", $iX, $iY)
    GUISetState()
    GUISetOnEvent(-3, "_Close")

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

    _GDIPlus_Startup()
    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iX, $iY, $hGraphics)
    Local $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    Local $pen_size = 128
    Local $hPen = _GDIPlus_PenCreate(0xFF00FF00, $pen_size)
    _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)
    _GDIPlus_GraphicsClear($hBackbuffer)
    _GDIPlus_GraphicsDrawEllipse($hBackbuffer, $pen_size / 2, $pen_size / 2, $iX - $pen_size, $iY - $pen_size, $hPen)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iX, $iY)

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

    GUIRegisterMsg($WM_ERASEBKGND, "ReDraw")

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

    While Sleep(30000)
    WEnd

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

    Func ReDraw()
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iX, $iY)
    Return 1
    EndFunc

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

    Func _Close()
    GUIRegisterMsg($WM_TIMER, "")
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

    [/autoit]

    Beispiel 2 (GUICtrlCreatePic()):

    Spoiler anzeigen
    [autoit]


    ;coded by UEZ 2011
    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>

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

    Global Const $IMAGE_BITMAP = 0
    Global Const $STM_SETIMAGE = 0x0172
    Global $msg
    _GDIPlus_Startup()
    Global Const $png = StringReplace(@AutoItExe, "autoit3.exe", "Examples\GUI\Torus.png")
    Global Const $hImage = _GDIPlus_ImageLoadFromFile($png)
    Global Const $hGUI = GUICreate("Display PNG Image in picture control", _GDIPlus_ImageGetWidth($hImage), _GDIPlus_ImageGetHeight($hImage))
    Global Const $idPic = GUICtrlCreatePic("", 0, 0)
    Global Const $Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    _WinAPI_DeleteObject(GUICtrlSendMsg($idPic, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp))
    GUISetState()

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

    While True
    $msg = GUIGetMsg()
    Switch $msg
    Case $idPic
    MsgBox(0, "Information", "PNG image was clicked")
    Case $GUI_EVENT_CLOSE
    _WinAPI_DeleteObject($Bmp)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
    Exit
    EndSwitch
    WEnd

    [/autoit]

    Gruß,
    UEZ

  • PNG ohne Rahmen darstellen

    • UEZ
    • 19. Januar 2012 um 23:35

    Stimmt, das wollte ich auch noch erwähnen!

    Gruß,
    UEZ

  • PNG ohne Rahmen darstellen

    • UEZ
    • 19. Januar 2012 um 23:08

    Du musst das Bild wieder in den GDI+ Grafik Handle hinein kopieren -> z.B. GUIRegisterMsg: WM_ERASEBKGND prüfen, ob die GUI gelöscht wurde.

    Gruß,
    UEZ

  • TGA Bild zu einem Jpg oder Bmp Bild?

    • UEZ
    • 19. Januar 2012 um 00:40

    Ich habe mal die FreeImage.au3 in eine "Read from Memory" Version umgewandelt. D.h. sie beinhaltet die DLL.

    Example 2:

    [autoit]


    #include "FreeImageFromMem.au3"

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

    _FreeImage_Initialise()

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

    $sFile = "800x600.tga"

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

    $FIF = _FreeImage_GetFileTypeU($sFile)
    If $FIF = $FIF_UNKNOWN Then
    $FIF = _FreeImage_GetFIFFromFilenameU($sFile)
    EndIf
    $hImage = _FreeImage_LoadU($FIF, $sFile)
    _FreeImage_SaveU($FIF_JPEG, $hImage, "800x600_new.jpg")
    _FreeImage_Unload($hImage)
    _FreeImage_DeInitialise()

    [/autoit]


    Gruß,
    UEZ

    Dateien

    FreeImageFromMem.7z 1,35 MB – 291 Downloads
  • Happy Birthday Oscar

    • UEZ
    • 18. Januar 2012 um 22:22

    Ich schließe mich den Vorrednern an und wünsche dir alles Gute zum Geburtstag!

    Gruß,
    UEZ

  • GUI anzeigen UND aus der taskleiste ausblenden?

    • UEZ
    • 16. Januar 2012 um 23:36
    Zitat von SgtIgram


    ...
    echt spitze wie bei dir alles wie aus der kanone geschossen kommt^^
    ...


    Hmmm, also einen Orgasmus hatte ich nicht... :P

    Gruß,
    UEZ ;)

  • eukalyptus memFont und GDI+

    • UEZ
    • 16. Januar 2012 um 21:49

    Hier noch ein Beispiel:

    Source Code ist zu groß für die Code Box -> http://pastebin.com/KKqi3WBe

    Gruß,
    UEZ

  • Daten aus .txt auslesen, Txt anhand der Daten erstellen und Inhalt einfügen

    • UEZ
    • 15. Januar 2012 um 22:33

    Probiere es mal damit:

    [autoit]


    #include <File.au3>

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

    Global $aZahlen
    _FileReadToArray(@ScriptDir & "\Zahlen.txt", $aZahlen)

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

    For $i = 1 To $aZahlen[0]
    $hFile = FileOpen(@ScriptDir & "\" & $aZahlen[$i] & ".txt", 2)
    FileWrite($hFile, $aZahlen[$i])
    FileClose($hFile)
    Next

    [/autoit]

    Zahlen.txt ist die Datei mit den 4 Zeilen an Zahlen.

    Gruß,
    UEZ

  • Musik Visualiserung

    • UEZ
    • 14. Januar 2012 um 18:29

    Irgendwie kommt mir das bekannt vor... ;)

    Schaue mal hier nach: Audio Visualization Collection

    Gruß,
    UEZ

  • GUI anzeigen UND aus der taskleiste ausblenden?

    • UEZ
    • 11. Januar 2012 um 23:25

    Guckst du hier:

    [autoit]


    #include <GUIConstantsEx.au3>

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

    $hGUI = GUICreate("No Taskbar", 200, 200, -1, -1, Default, Default, WinGetHandle(AutoItWinGetTitle()))
    GUISetState()

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

    [/autoit]

    Gruß,
    UEZ

  • UDF - TrueType Fonts im Script mitgeben und verwenden

    • UEZ
    • 11. Januar 2012 um 22:42

    "Nur" den Font in den Binärstring umwandeln reicht nicht. DU musst auch die Zeile

    GUICtrlSetFont(-1, 20, 400, 0, <Fontname>")

    anpassen, wobei der Fontname nicht der Dateiname ist, sondern der interne Name -> Eigenschatf TTF -> Title.


    Gruß,
    UEZ

    Dateien

    Fluted Germanica.7z 27,44 kB – 503 Downloads
  • Gui-Fenster "magnetisch" machen?

    • UEZ
    • 8. Januar 2012 um 21:10

    Oder vielleicht hier: http://www.autoitscript.com/forum/topic/24342-form-snap oder hier: http://www.autoitscript.com/forum/topic/12…w-alignment-udf

    Gruß,
    UEZ

  • Png, Jpg in Menü einfügen?

    • UEZ
    • 7. Januar 2012 um 21:14

    Probiere es mal damit:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <GuiMenu.au3>
    #include <WindowsConstants.au3>
    #include <GDIPlus.au3>
    #Include <GuiMenu.au3>
    $Form1 = GUICreate("Form1", 615, 438, 192, 124)
    Global Enum $idSave = 1000
    $hFile = _GUICtrlMenu_CreateMenu()
    _GUICtrlMenu_InsertMenuItem($hFile, 0, "&Speichern", $idSave)
    $hMain = _GUICtrlMenu_CreateMenu()
    _GUICtrlMenu_InsertMenuItem($hMain, 0, "&Datei", 0, $hFile)
    _GUICtrlMenu_SetMenu($Form1, $hMain)
    GUISetState()
    Global Const $sFile = StringReplace(@AutoItExe, "autoit3.exe", "Examples\GUI\Torus.png")
    Global $hBMP_File_Save = _GUICtrlMenu_CreateBitmap($sFile, 0)
    _GUICtrlMenu_SetItemBmp($hFile, 0, $hBMP_File_Save)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _WinAPI_DeleteObject($hBMP_File_Save)
    Exit
    EndSwitch
    WEnd

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

    Func _GUICtrlMenu_CreateBitmap($file, $iIndex = 0, $iW = 18, $iH = 18)
    If FileExists($file) Then
    Local $iStride = 0, $iPixelFormat = $GDIP_PXF32ARGB, $pScan0 = 0
    Local $GDIp = True, $Ret, $hIcon, $hImage, $hBitmap, $hContext, $hIcon
    If Not $ghGDIPDll Then
    $GDIp = False
    _GDIPlus_Startup()
    EndIf
    Local $fext = StringMid($file, StringLen($file) - 3)
    Switch $fext
    Case ".dll"
    $Ret = DllCall("shell32", "long", "ExtractAssociatedIcon", "int", 0, "str", $file, "int*", $iIndex)
    If @error Then Return SetError(2, @extended, 0)
    $hIcon = $Ret[0]
    $Ret = DllCall($ghGDIPDll, "int", "GdipCreateBitmapFromHICON", "ptr", $hIcon, "int*", 0)
    If @error Then Return SetError(3, @extended, 0)
    $hImage = $Ret[2]
    _WinAPI_DestroyIcon($hIcon)
    Case ".jpg", ".png", ".bmp", ".gif"
    $hImage = _GDIPlus_ImageLoadFromFile($file)
    If @error Then Return SetError(4, @extended, 0)
    EndSwitch

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

    $Ret = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iW, "int", $iH, "int", $iStride, "int", $iPixelFormat, "ptr", $pScan0, "int*", 0)
    If @error Then Return SetError(5, @extended, 0)
    $hBitmap = $Ret[6]
    $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsDrawImageRect($hContext, $hImage, 0, 0, $iW, $iH)
    $hIcon = _GDIPlus_BitmapCreateDIBFromBitmap($hBitmap)
    _GDIPlus_GraphicsDispose($hContext)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_BitmapDispose($hImage)
    If Not $GDIp Then _GDIPlus_Shutdown()
    Return $hIcon
    Else
    Return SetError(1, 0, 0)
    EndIf
    EndFunc ;==>_GUICtrlMenu_CreateBitmap

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

    Func _GDIPlus_BitmapCreateDIBFromBitmap($hBitmap)
    Local $tBIHDR, $Ret, $tData, $pBits, $hResult = 0
    $Ret = DllCall($ghGDIPDll, 'uint', 'GdipGetImageDimension', 'ptr', $hBitmap, 'float*', 0, 'float*', 0)
    If (@error) Or ($Ret[0]) Then Return 0
    $tData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $Ret[2], $Ret[3], $GDIP_ILMREAD, $GDIP_PXF32ARGB)
    $pBits = DllStructGetData($tData, 'Scan0')
    If Not $pBits Then Return 0
    $tBIHDR = DllStructCreate('dword;long;long;ushort;ushort;dword;dword;long;long;dword;dword')
    DllStructSetData($tBIHDR, 1, DllStructGetSize($tBIHDR))
    DllStructSetData($tBIHDR, 2, $Ret[2])
    DllStructSetData($tBIHDR, 3, $Ret[3])
    DllStructSetData($tBIHDR, 4, 1)
    DllStructSetData($tBIHDR, 5, 32)
    DllStructSetData($tBIHDR, 6, 0)
    $hResult = DllCall('gdi32.dll', 'ptr', 'CreateDIBSection', 'hwnd', 0, 'ptr', DllStructGetPtr($tBIHDR), 'uint', 0, 'ptr*', 0, 'ptr', 0, 'dword', 0)
    If (Not @error) And ($hResult[0]) Then
    DllCall('gdi32.dll', 'dword', 'SetBitmapBits', 'ptr', $hResult[0], 'dword', $Ret[2] * $Ret[3] * 4, 'ptr', DllStructGetData($tData, 'Scan0'))
    $hResult = $hResult[0]
    Else
    $hResult = 0
    EndIf
    _GDIPlus_BitmapUnlockBits($hBitmap, $tData)
    Return $hResult
    EndFunc ;==>_GDIPlus_BitmapCreateDIBFromBitmap

    [/autoit]

    Ich werde bei Gelegenheit die UDF anpassen, damit sie auch Bilderdateien laden kann.

    Gruß,
    UEZ

  • Png, Jpg in Menü einfügen?

    • UEZ
    • 7. Januar 2012 um 17:27

    Hilft dir das hier vielleicht weiter? -> _GUICtrlMenu_CreateBitmap() v0.55 Build 2011-08-16 beta - Erstellt Icons für GUI Menüs

    Gruß,
    UEZ

  • Mp3 Datei im Script einbinden ohne Fileinstall?

    • UEZ
    • 6. Januar 2012 um 21:27

    Schaue mal hier nach -> File to Base64 String Code Generator v1.03 Build 2011-11-21

    Gruß,
    UEZ

  • Spalte aus einer CSV Datei ermitteln

    • UEZ
    • 5. Januar 2012 um 15:38

    Hilft dir das weiter:

    [autoit]


    #include <Array.au3>
    $CPUTemp_Log = FileRead("CT-Log 2011-12-27 12-10-50.csv")
    $aCPUTemp_Log = StringRegExp($CPUTemp_Log, "(\d+:\d+:\d+\s\d+/\d+/\d+),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),", 4)
    $Anzahl_Messungen = UBound($aCPUTemp_Log)

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

    ;alle Messungen anzeigen
    For $i = 0 To $Anzahl_Messungen - 1
    _ArrayDisplay($aCPUTemp_Log[$i])
    Next

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

    ;Core Load % der 8. Messung in Spalte 13 anzeigen
    $aTemp = $aCPUTemp_Log[8]
    MsgBox(0, "Test", "Core Load % der 8. Messung: " & $aTemp[13] & " %")

    [/autoit]

    Gruß,
    UEZ

  • Spalte aus einer CSV Datei ermitteln

    • UEZ
    • 4. Januar 2012 um 20:59

    Wo ist der CSV Anhang?

    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™