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

  • Speicherleck bei Load_BMP_From_Mem()

    • UEZ
    • 2. März 2011 um 22:35

    Ist mir nie aufgefallen, dass Load_BMP_From_Mem() ein Memory Leak hat! Habe i.d.R. nur einmal n Bilder geladen, somit ist das mir nie aufgefallen!

    Danke an progandy für die fehlerfreie Lösung. :thumbup:

    Hier meine Version ohne Memory Leak:

    [autoit]


    ;======================================================================================
    ; Function Name: Load_BMP_From_Mem
    ; Description: Loads a image which is saved as a binary string and converts it to a bitmap or hbitmap
    ;
    ; Parameters: $mem_image: the binary string which contains any valid image which is supported by GDI+
    ; Optional: $hHBITMAP: if false a bitmap will be created, if true a hbitmap will be created
    ;
    ; Remark: hbitmap format is used generally for GUI internal images
    ;
    ; Requirement(s): GDIPlus.au3, Memory.au3
    ; Return Value(s): Success: handle to bitmap or hbitmap, Error: 0
    ; Error codes: 1: $mem_image is not a binary string
    ;
    ; Author(s): UEZ
    ; Additional Code: thanks to progandy for the MemGlobalAlloc and tVARIANT lines
    ; Version: v0.95 Build 2011-06-11 Beta
    ;=======================================================================================
    Func Load_BMP_From_Mem($mem_image, $hHBITMAP = False)
    If Not IsBinary($mem_image) Then Return SetError(1, 0, 0)
    Local $declared = True
    If Not $ghGDIPDll Then
    _GDIPlus_Startup()
    $declared = False
    EndIf
    Local Const $memBitmap = Binary($mem_image) ;load image saved in variable (memory) and convert it to binary
    Local Const $len = BinaryLen($memBitmap) ;get length of image
    Local Const $hData = _MemGlobalAlloc($len, $GMEM_MOVEABLE) ;allocates movable memory ($GMEM_MOVEABLE = 0x0002)
    Local Const $pData = _MemGlobalLock($hData) ;translate the handle into a pointer
    Local $tMem = DllStructCreate("byte[" & $len & "]", $pData) ;create struct
    DllStructSetData($tMem, 1, $memBitmap) ;fill struct with image data
    _MemGlobalUnlock($hData) ;decrements the lock count associated with a memory object that was allocated with GMEM_MOVEABLE
    Local $hStream = DllCall("ole32.dll", "int", "CreateStreamOnHGlobal", "handle", $pData, "int", True, "ptr*", 0)
    $hStream = $hStream[3]
    Local $hBitmap = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromStream", "ptr", $hStream, "int*", 0) ;Creates a Bitmap object based on an IStream COM interface
    $hBitmap = $hBitmap[2]
    Local Const $tVARIANT = DllStructCreate("word vt;word r1;word r2;word r3;ptr data; ptr")
    DllCall("oleaut32.dll", "long", "DispCallFunc", "ptr", $hStream, "dword", 8 + 8 * @AutoItX64, _
    "dword", 4, "dword", 23, "dword", 0, "ptr", 0, "ptr", 0, "ptr", DllStructGetPtr($tVARIANT)) ;release memory from $hStream to avoid memory leak
    $tMem = 0
    If $hHBITMAP Then
    Local Const $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _GDIPlus_BitmapDispose($hBitmap)
    If Not $declared Then _GDIPlus_Shutdown()
    Return $hHBmp
    EndIf
    If Not $declared Then _GDIPlus_Shutdown()
    Return $hBitmap
    EndFunc ;==>Load_BMP_From_Mem

    [/autoit]

    Gruß,
    UEZ

  • StringRegExpReplace und Whitespaces

    • UEZ
    • 2. März 2011 um 11:34

    Würde ein StringReplace() nicht helfen?

    Gruß,
    UEZ

  • StringRegExpReplace und Whitespaces

    • UEZ
    • 2. März 2011 um 09:37

    Kannst du eine Beispiel XML Datei zur Verfügung stellen?

    Gruß,
    UEZ

  • eukalyptus ist 32

    • UEZ
    • 2. März 2011 um 09:16

    Herzlichen Glückwunsch an den GDI+ Meister :thumbup: und alles, alles Gute, viel Gesundheit und viel GDI+ Inspiration! :D

    Code
    :::    :::     :::     :::::::::  :::::::::  :::   ::: 
    :+:    :+:   :+: :+:   :+:    :+: :+:    :+: :+:   :+: 
    +:+    +:+  +:+   +:+  +:+    +:+ +:+    +:+  +:+ +:+  
    +#++:++#++ +#++:++#++: +#++:++#+  +#++:++#+    +#++:   
    +#+    +#+ +#+     +#+ +#+        +#+           +#+    
    #+#    #+# #+#     #+# #+#        #+#           #+#    
    ###    ### ###     ### ###        ###           ###    
     .----------------.  .----------------.  .----------------.  .----------------.  .----------------.  .----------------.  .----------------.  .----------------. 
    | .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
    | |   ______     | || |     _____    | || |  _______     | || |  _________   | || |  ____  ____  | || |  ________    | || |      __      | || |  ____  ____  | |
    | |  |_   _ \    | || |    |_   _|   | || | |_   __ \    | || | |  _   _  |  | || | |_   ||   _| | || | |_   ___ `.  | || |     /  \     | || | |_  _||_  _| | |
    | |    | |_) |   | || |      | |     | || |   | |__) |   | || | |_/ | | \_|  | || |   | |__| |   | || |   | |   `. \ | || |    / /\ \    | || |   \ \  / /   | |
    | |    |  __'.   | || |      | |     | || |   |  __ /    | || |     | |      | || |   |  __  |   | || |   | |    | | | || |   / ____ \   | || |    \ \/ /    | |
    | |   _| |__) |  | || |     _| |_    | || |  _| |  \ \_  | || |    _| |_     | || |  _| |  | |_  | || |  _| |___.' / | || | _/ /    \ \_ | || |    _|  |_    | |
    | |  |_______/   | || |    |_____|   | || | |____| |___| | || |   |_____|    | || | |____||____| | || | |________.'  | || ||____|  |____|| || |   |______|   | |
    | |              | || |              | || |              | || |              | || |              | || |              | || |              | || |              | |
    | '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |
     '----------------'  '----------------'  '----------------'  '----------------'  '----------------'  '----------------'  '----------------'  '----------------'
    Alles anzeigen

    Gruß,
    UEZ

  • _GDI+_MatrixRotate

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

    Schau' mal hier: [ offen ] GDI - Png drehen und auf Hintergrund zeichen

    Gruß,
    UEZ

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

    • UEZ
    • 1. März 2011 um 20:34

    Auch bei der "Grab Screen" Funktion ist es unter Aero anders, denn mit Aero kann man die Markierung in dem Zoom Fenster sehen, ansonsten nur den blickenden Punkt.

    Aero ist cool 8)

    Gruß,
    UEZ

  • _GDI+_MatrixRotate

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

    Du musst den Grafikspeicher vor dem erneuten Zeichnen löschen.

    Gruß,
    UEZ

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

    • UEZ
    • 1. März 2011 um 14:32

    Keine Ahnung, wie du das machst, aber probiere mal diesen Link: http://www.4shared.com/file/A8sNeOt5/…eenshooter.html

    Ist als Zip gepackt.

    Gruß,
    UEZ

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

    • UEZ
    • 1. März 2011 um 12:01

    Genau das will ich nicht, dass das Fenster sichtbar ist. ;) Bei sichtbarem Fenster ist auch nur ein Teil der Seite sichtbar... Unter WinXP funzt auch der Screenshot von sichtbaren Fenstern...

    Gruß,
    UEZ

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

    • UEZ
    • 28. Februar 2011 um 21:40

    Komisch! Hat irgend jemand die gleichen Probleme?

    Gruß,
    UEZ

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

    • UEZ
    • 28. Februar 2011 um 19:48

    Kleines Update: habe ein "Memory Leak" zufällig entdeckt - sollte jetzt gefixt sein. :cursing:

    Bei der "Grab Screen" Funktion habe ich noch ein Zoom Fenster eingebaut, damit das Markieren eines Bildbereiches präziser durchgeführt werden kann.

    Ach ja, das Erstellen von Screenshots von Web Seiten funktioniert nur mit eingeschaltetem Aero! Warum das so ist, keine Ahnung. ?(

    Gruß,
    UEZ

  • Schnellster Perlin-Noise Generator

    • UEZ
    • 26. Februar 2011 um 20:20

    Funzt jetzt! :thumbup:

    Gruß,
    UEZ

  • Schnellster Perlin-Noise Generator

    • UEZ
    • 26. Februar 2011 um 19:08

    Bei mir sturzt dein Skript ab: AutoIT3.exe ended.rc:-1073741819 (FFFFFFFFC0000005)

    Gruß,
    UEZ

  • Unterschied zwischen "Not" und "<>" ?

    • UEZ
    • 25. Februar 2011 um 10:53

    Not ist ein boolescher Operator, d.h. wahr oder falsch bzw. nicht wahr oder nicht falsch.

    Du kannst damit nicht prüfen, ob z.B. eine Zahl größer ist als eine andere.

    Gruß,
    UEZ

  • AutoIt auf remote Rechner

    • UEZ
    • 24. Februar 2011 um 16:30

    Vielleicht hilft dir die SAP UDF: http://www.autoitscript.com/forum/topic/86574-sap-udf

    Gruß,
    UEZ

  • DHCP Server auslesen

    • UEZ
    • 24. Februar 2011 um 15:54

    Führe ScriptomaticV2.hta aus, warte ein bissl und schaue unter WMI Class nach, ob dort irgendwo was von DHCP steht.

    Wenn ja, kann man das Ganze auch in AutoIt coden, falls die Infos brauchbar sind.

    Gruß,
    UEZ

    Dateien

    ScriptomaticV2.7z 10,08 kB – 726 Downloads
  • DHCP Server auslesen

    • UEZ
    • 24. Februar 2011 um 13:33

    Kannst du per WMI die DHCP Informationen lesen?

    Gruß,
    UEZ

  • DHCP Server auslesen

    • UEZ
    • 24. Februar 2011 um 10:10

    Auf den Servern, wo ein DHCP Dienst läuft, läuft's ohne Probleme.

    Auf Workstation habe ich noch nie getestet.

    Gruß,
    UEZ

  • DHCP Server auslesen

    • UEZ
    • 24. Februar 2011 um 09:23

    Du kannst mit dem CMD Befehl: netsh DHCP server dump dir die DHCP Konfig ausgeben lassen. Per STDIN kannst du den Stream einlesen und nach den gesuchten Zeilen schauen.

    Add Optiondef 66 "Boot Server Host Name" STRING 0 comment="TFTP boot server host name"
    Add Optiondef 67 "Bootfile Name" STRING 0 comment="Bootfile Name"

    Ich hoffe, dass hilft dir ein bissl weiter.

    Gruß,
    UEZ

  • GUICtrlCreateInput: Pic als Background?

    • UEZ
    • 21. Februar 2011 um 16:53

    Probiere mal das hier aus:

    Spoiler anzeigen
    [autoit]


    ;coded by Großvater
    #include <GUIConstantsEx.au3>
    #include <WinAPI.au3>
    #include <WindowsConstants.au3>

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

    Const $IMAGE_BITMAP = 0x0000
    Const $STM_SETIMAGE = 0x0172
    Const $STM_GETIMAGE = 0x0173

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

    GUICreate("Dummy")
    $au3path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir")
    $Pic = $au3path & "\Examples\GUI\msoobe.jpg"
    $idPIC = GUICtrlCreatePic($Pic, 0, 0, 198, 18)
    $hBitmap = GUICtrlSendMsg($idPIC, $STM_GETIMAGE, $IMAGE_BITMAP, 0)
    $aR = DllCall("Gdi32.dll", "Handle", "CreatePatternBrush", "Handle", $hBitmap)
    $hBrush = $aR[0]

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

    $hGUI = GUICreate("Test", 400, 100)
    $idINP = GUICtrlCreateInput("", 20, 20, 200, 20)
    $hINP = GUICtrlGetHandle($idINP)
    $InputColor = 0xFFFFFF

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

    GUICtrlCreateInput("", 20, 60, 200, 20)

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

    GUIRegisterMsg($WM_CTLCOLOREDIT, "ColorInput")
    If @OSBuild > 5999 Then GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND")

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

    GUISetState()

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

    While True
    $Msg = GUIGetMsg()
    Switch $Msg
    Case $GUI_EVENT_CLOSE
    DllCall("Gdi32.dll", "BOOL", "DeleteObject", "Handle", $hBrush)
    Exit
    EndSwitch
    WEnd

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

    Func ColorInput($hWnd, $iMsg, $wParam, $lParam)
    If $lParam = $hINP Then
    DllCall("Gdi32.dll", "UINT", "SetTextColor", "Handle", $wParam, "UInt", $InputColor)
    DllCall("Gdi32.dll", "Int", "SetBkMode", "Handle", $wParam, "Int", 1)
    Return $hBrush
    EndIf
    Return $GUI_RUNDEFMSG
    EndFunc

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

    Func WM_ERASEBKGND($hWnd, $iMsg, $wParam, $lParam)
    _WinAPI_RedrawWindow($hGUI, "", "", BitOR($RDW_INVALIDATE, $RDW_UPDATENOW))
    Return 1
    EndFunc

    [/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™