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

  • Teiltransparenter Label-Background

    • UEZ
    • 5. Oktober 2011 um 15:08

    Um das Stauchen abzustellen, kannst du

    [autoit]


    Global Const $idPic = GUICtrlCreatePic("", 0, 0, $iImgWidth, $iImgHeight)

    [/autoit]

    nehmen.

    Mit den Tabs muss ich mal schauen, ob das funzt.

    Gruß,
    UEZ

  • Teiltransparenter Label-Background

    • UEZ
    • 5. Oktober 2011 um 14:39

    Vielleicht so?

    Spoiler anzeigen
    [autoit]


    ;coded by UEZ 2011
    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    _GDIPlus_Startup()
    Global Const $IMAGE_BITMAP = 0
    Global Const $STM_SETIMAGE = 0x0172

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

    Global Const $path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir")
    Global Const $sFile = $path & "\Examples\GUI\mslogo.jpg"
    Global Const $hImage = _GDIPlus_ImageLoadFromFile($sFile)
    Global Const $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    Global Const $iImgWidth = _GDIPlus_ImageGetWidth($hImage)
    Global Const $iImgHeight = _GDIPlus_ImageGetHeight($hImage)
    Global Const $hGUI = GUICreate("Test", $iImgWidth, $iImgHeight)
    Global Const $idPic = GUICtrlCreatePic("", 0, 0, $iImgWidth, $iImgHeight)
    GuiCtrlSetState(-1, $GUI_DISABLE)
    GUISetState()
    _WinAPI_DeleteObject(GUICtrlSendMsg($idPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap))

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

    Global Const $iLabelW = 130
    Global Const $iLabelH = 25
    Global Const $iLabelX = 0
    Global Const $iLabelY= 0
    Global Const $idLabelBg = GUICtrlCreatePic("", $iLabelX, $iLabelY, $iLabelW, $iLabelH)
    Global Const $hBG_Bitmap = Create_BgBitmap($iLabelW, $iLabelH)
    _WinAPI_DeleteObject(GUICtrlSendMsg($idLabelBg, $STM_SETIMAGE, $IMAGE_BITMAP, $hBG_Bitmap))

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

    Global Const $idLabel = GUICtrlCreateLabel("This is a test!", $iLabelX, $iLabelY, $iLabelW, $iLabelH)
    GUICtrlSetFont(-1, 16)
    GUICtrlSetColor(-1, 0x40FF40)
    GUICtrlSetBkColor(-1, -2)

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

    While True
    $msg = GUIGetMsg()
    Switch $msg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_ImageDispose($hImage)
    _WinAPI_DeleteObject($hBitmap)
    _WinAPI_DeleteObject($hBG_Bitmap)
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
    Exit
    EndSwitch
    WEnd

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

    Func Create_BgBitmap($iWidth, $iHeight, $iColor = 0x80FFFFFF)
    Local Const $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    Local Const $hBitmap = $aResult[6]
    Local Const $hBrush = _GDIPlus_BrushCreateSolid($iColor)
    Local Const $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsFillRect($hContext, 0, 0, $iWidth, $iHeight, $hBrush)
    _GDIPlus_GraphicsDispose($hContext)
    _GDIPlus_BrushDispose($hBrush)
    Return _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • name22 feiert seinen 17ten

    • UEZ
    • 5. Oktober 2011 um 09:19

    Auch von mir alles Gute!

    Gruß,
    UEZ

  • AutoIt Windows Screenshooter v1.87 Build 2026-09-01

    • UEZ
    • 3. Oktober 2011 um 13:13

    Das Fenster, was du siehst, kommt von der Avifil32.dll, die die installienten Codecs auf dem System anzeigt.

    Eine Ini ist nicht geplant, denn du müsstest noch weitere Parameter (siehe $AVICOMPRESSOPTIONS Struktur) mitgeben, die nicht statisch sind.

    Hat jemand DEP aktiviert für alles Programme und Dienste? Wenn ja, dann führt das in Verbindung mit dem Windows Screenshooter zu Problemen, da verschiedene DLL aus dem Speicher geladen werden!
    Z.B: wird stürzt das About Intro und einige Bild Manipulationsfunktionen ab!

    Gruß,
    UEZ

  • AutoIt Windows Screenshooter v1.87 Build 2026-09-01

    • UEZ
    • 2. Oktober 2011 um 21:46

    Tweaky:

    Zu den Codecs: welcher Codec am Besten ist, musst du ausprobieren, denn jeder Codec hat seine Vor- bzw. Nachteile. Du kannst auch XViD oder irgend welche anderen Codecs installieren und benutzen!

    Dauer: hast recht, da stimmt was nicht - muss da nochmals genauer schauen, was da schief läuft.

    Danke für dein Feedback!

    Gruß,
    UEZ

  • Amperemeter mit GDIPlus DLL

    • UEZ
    • 27. September 2011 um 19:41

    Aha, 20 Amperemeter! Ich wüsste nicht, was ich alles anzeigen sollte, aber da hast du recht - bei einem ist AutoIt "schnell" genug.

    Wenn ich was dagegen hätte, würde ich nie den Source Code veröffentlichen und abgesehen davon muss niemand um Erlaubnis für die veröffentlichten Codes fragen :!:

    Ich habe mir schon VS2010 installiert, aber das Monster zu bedienen ist eine Sache, die andere ein simples "Hello World" hinzugekommen. 8|

    Eigene DLLs per Memory Calls in das AutoIt Skript einzubauen ist eine feine Sache. Keine Ahnung, was man mit dem Inline C++ alles anstellen kann, so dass du den Weg über die ext. DLL nicht gehen musst.

    Gruß,
    UEZ

  • Amperemeter mit GDIPlus DLL

    • UEZ
    • 27. September 2011 um 19:10
    Zitat von funkey

    Ich hatte bisher immer die Amperemeter für einige meiner Programme rein mittels AutoIt und der GDIPlus-UDF gezeichnet, das war mir aber zu langsam, deshalb habe ich beschlossen das ganze in eine DLL auszulagern und es lief wie erwartet bedeutend schneller.
    Ich habe 2 Arten von Amperemetern erstellt, einmal zeichne ich direkt auf die Gui, das zweite Mal erstelle ich ein Pic-Control und setze dort das Bitmap. Das zweite hat den Vorteil, das man sich um nichts zu kümmern braucht, was das Neuzeichnen angeht, wenn ein Fenster drübergeschoben wird, allerdings flackert es, wenn man es zu oft updatet.
    Das erste kann man so oft wie nur irgendmöglich updaten und es flackert dank Backbuffer nicht.

    Ich hoffe es kann jemand brauchen, darum teile ich es nun mit euch. C++-Source und AutoIt-Beispiel ist dabei.


    Was meinst du mit "zu langsam"? Um wie viel es ist zu langsam? Mein Visualizer arbeitet eigentlich mit "ordentlicher" Performance, wobei der Hauptcode von 2009 ist und somit noch genug Raum zum Tunen hat!

    Ansonsten möchte ich irgend wann mal C/C++ lernen und bin um jeden Source Code dankbar.

    Gruß,
    UEZ

  • GDI+ Grafik unterschiedlich schnell

    • UEZ
    • 26. September 2011 um 11:27

    Das liegt an der Hauptschleife -> GUIGetMsg()

    Benutze die Opt("GuiOnEventMode", 1) Methode anstelle. Danach sollte der Unterschied weg sein.

    Gruß,
    UEZ

  • CPU Auslastung Auslesen

    • UEZ
    • 24. September 2011 um 21:33

    Mit AutoIt ist es nicht möglich die CPU Last auf alle Kerne zu verteilen, d.h. es wird immer "nur" ein Core eingeheizt.

    Gruß,
    UEZ

  • [GDI+] Falling Code

    • UEZ
    • 24. September 2011 um 21:28

    name22: die Betonung liegt auf oder.

    MemFont is praktischer, aber zum Testen ist das Laden einfacher.

    Gruß,
    UEZ ;)

  • [GDI+] Falling Code

    • UEZ
    • 24. September 2011 um 20:27

    Oder du lädst einfach den Font ohne ihn zu installieren:

    Spoiler anzeigen
    [autoit]


    #include <Color.au3>
    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    #include <Misc.au3>
    #include <WindowsConstants.au3>

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

    Opt("GuiOnEventMode", 1)

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

    Global $color = 0x00FF00
    Global $number = 100
    Global $iGUIHeight = @DesktopHeight
    Global $iGUIWidth = @DesktopWidth
    Global $sFPS = 15 ;Bilder/Sekunde, je höher desto schneller

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

    Global $nX[$number], $nY[$number]

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

    Global $hGUI = GUICreate("Falling Code by clezZ (c) 2011", $iGUIWidth, $iGUIHeight, 0, 0, $WS_POPUP)
    GUISetState()
    WinSetTrans($hGUI, "", 0xFF)

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

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

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

    _GDIPlus_Startup()

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

    Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iGUIWidth, $iGUIHeight, $hGraphics)
    Global $hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)

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

    _GDIPlus_GraphicsSetSmoothingMode($hBuffer, 2)
    DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $hBuffer, "int", 4)
    Global $hBrush = _GDIPlus_BrushCreateSolid(0xFF00FF00)

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

    _GDIPlus_GraphicsClear($hBuffer, 0xFF000000)

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

    Global $hTi, $chr, $tLayout, $aInfo, $pLayout, $aResult, $aChr[2]
    Global $sString, $nSize = 24

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

    For $i = 0 To $number - 1
    $nX[$i] = Random($nSize, $iGUIWidth - $nSize, 1)
    $nY[$i] = Random($nSize, $iGUIHeight - $nSize, 1)
    Next

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

    Global $font = @ScriptDir & "\matrix code nfi.ttf"
    Global $fontname = "Matrix Code NFI"
    Global $hFormat = _GDIPlus_StringFormatCreate(0)
    Global $hCollection = DllCall($ghGDIPDll, 'int', 'GdipNewPrivateFontCollection', 'ptr*', 0)
    $hCollection = $hCollection[1]
    DllCall($ghGDIPDll, 'int', 'GdipPrivateAddFontFile', 'ptr', $hCollection, 'wstr', $font)
    Global $hFamily = DllCall($ghGDIPDll, 'int', 'GdipCreateFontFamilyFromName', 'wstr', $fontname, 'ptr', $hCollection, 'int*', 0)
    $hFamily = $hFamily[3]
    Global $hFont = _GDIPlus_FontCreate($hFamily, $nSize, 1)

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

    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iGUIWidth, $iGUIHeight)

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

    HotKeySet("c", "_color")

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

    While 1
    $hTi = TimerInit()
    _Draw()
    Sleep(1000 / $sFPS - TimerDiff($hTi))
    WEnd

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

    Func _Draw()
    _GDIPlus_GraphicsClear($hBuffer, 0x35000000)
    For $i = 0 To $number - 1
    $aChr[0] = Random(33, 63, 1)
    $aChr[1] = Random(90, 127, 1)
    $sString = Chr($aChr[Random(0, 1, 1)])
    $nY[$i] += $nSize + 3

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

    $tLayout = _GDIPlus_RectFCreate($nX[$i], $nY[$i], 0, 0)
    $aInfo = _GDIPlus_GraphicsMeasureString($hBuffer, $sString, $hFont, $tLayout, $hFormat)
    $pLayout = DllStructGetPtr($tLayout)
    If $nY[$i] > $iGUIHeight Then
    $nY[$i] = $nY[$i] - $iGUIHeight - 2 * $nSize
    $nX[$i] = Random($nSize, $iGUIWidth - $nSize, 1)
    EndIf
    $aResult = DllCall($ghGDIPDll, "int", "GdipDrawString", "handle", $hBuffer, "wstr", $sString, "int", -1, "handle", $hFont, "ptr", $pLayout, "handle", $hFormat, "handle", $hBrush)
    Next
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iGUIWidth, $iGUIHeight)
    EndFunc ;==>_Draw

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

    Func _color()
    $color = _ChooseColor(2, $color)
    _GDIPlus_BrushSetSolidColor($hBrush, '0xFF' & Hex(_ColorGetRed($color), 2) & Hex(_ColorGetGreen($color), 2) & Hex(_ColorGetBlue($color), 2))
    EndFunc ;==>_color

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

    Func _Exit()
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hBuffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    Gruß,
    UEZ

  • [GDI+] Falling Code

    • UEZ
    • 24. September 2011 um 17:33

    Ist ganz nett geworden - Matrix Like!

    Ich würde irgend eine japanische Schrift verwenden, damit es näher an der Matrix ist...

    Gruß,
    UEZ

  • [Spiel] Drop Off

    • UEZ
    • 21. September 2011 um 20:37

    Schöne Umsetzung! Vielleicht würde der Hintergrund mit den Kugeln noch besser aussehen, wenn du den Kugeln "Volumen" gibts, ähnlich der Kugeln aus der LED Laufschrift.

    Gruß,
    UEZ

  • Kev wird 20

    • UEZ
    • 20. September 2011 um 12:26

    Auch von mir alles Gute zum Geburtstag nachträglich.

    Gruß,
    UEZ

  • GunFood ist 30

    • UEZ
    • 19. September 2011 um 09:14

    Auch von mir alles Gute zum Geburtstag!

    Gruß,
    UEZ

  • AVIMakeCompressedStream aktivieren

    • UEZ
    • 16. September 2011 um 21:16

    Hab's herausgefunden!

    Guckst du hier:

    Spoiler anzeigen
    [autoit]


    #AutoIt3Wrapper_UseX64=n
    #include <WinAPI.au3>

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

    #region AVIWriter UDF
    Global Const $OF_CREATE = 0x00001000
    Global Const $AVIIF_KEYFRAME = 0x00000010
    Global Const $ICMF_CHOOSE_KEYFRAME = 1, $ICMF_CHOOSE_DATARATE = 2
    Global Const $AVIERR_UNSUPPORTED = 0x80044065
    Global Const $AVIERR_BADPARAM = 0x80044066
    Global Const $AVIERR_MEMORY = 0x80044067
    Global Const $AVIERR_NOCOMPRESSOR = 0x80044071
    Global Const $AVIERR_CANTCOMPRESS = 0x80044075
    Global Const $AVIERR_ERROR = 0x800440C7
    Global Const $AVIERR_OK = 0
    Global $Avi32_Dll

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

    ;http://msdn.microsoft.com/en-us/library/…4(v=vs.85).aspx
    Global Const $BITMAPFILEHEADER = "WORD bfType;DWORD bfSize;WORD bfReserved1;WORD bfReserved2;DWORD bfOffBits;"
    ;~ Global Const $BITMAPFILEHEADER = "align 2;char magic[2];int size;short res1;short res2;ptr offset;"

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

    ;http://msdn.microsoft.com/en-us/library/…6(v=vs.85).aspx
    Global Const $BITMAPINFOHEADER = _
    "dword biSize;long biWidth;long biHeight;short biPlanes;short biBitCount;dword biCompression;" & _
    "dword biSizeImage;long biXPelsPerMeter;long biYPelsPerMeter;dword biClrUsed;dword biClrImportant;"

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

    ;http://msdn.microsoft.com/en-us/library/ms899423.aspx
    Global Const $AVISTREAMINFO = _
    "dword fccType;dword fccHandler;dword dwFlags;dword dwCaps;short wPriority;short wLanguage;dword dwScale;" & _
    "dword dwRate;dword dwStart;dword dwLength;dword dwInitialFrames;dword dwSuggestedBufferSize;dword dwQuality;" & _
    "dword dwSampleSize;int rleft;int rtop;int rright;int rbottom;dword dwEditCount;dword dwFormatChangeCount;wchar[64];"

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

    ;http://msdn.microsoft.com/en-us/library/…1(v=VS.85).aspx
    Global Const $AVICOMPRESSOPTIONS = _
    "DWORD fccType;DWORD fccHandler;DWORD dwKeyFrameEvery;DWORD dwQuality;DWORD dwBytesPerSecond;" & _
    "DWORD dwFlags;PTR lpFormat;DWORD cbFormat;PTR lpParms;DWORD cbParms;DWORD dwInterleaveEvery;"

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

    ;http://www.fourcc.org/codecs.php
    Func _Create_mmioFOURCC($FOURCC) ;coded by UEZ
    If StringLen($FOURCC) <> 4 Then Return SetError(1, 0, 0)
    Local $aFOURCC = StringSplit($FOURCC, "", 2)
    Return BitOR(Asc($aFOURCC[0]), BitShift(Asc($aFOURCC[1]), -8), BitShift(Asc($aFOURCC[2]), -16), BitShift(Asc($aFOURCC[3]), -24))
    EndFunc ;==>_Create_mmioFOURCC

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

    Func _DecodeFOURCC($iFOURCC); coded by UEZ
    If Not IsInt($iFOURCC) Then Return SetError(1, 0, 0)
    Return Chr(BitAND($iFOURCC, 0xFF)) & Chr(BitShift(BitAND(0x0000FF00, $iFOURCC), 8)) & Chr(BitShift(BitAND(0x00FF0000, $iFOURCC), 16)) & Chr(BitShift($iFOURCC, 24))
    EndFunc ;==>_DecodeFOURCC

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

    ; monoceres, Prog@ndy, UEZ
    Func _CreateAvi($sFilename, $FrameRate, $Width, $Height, $BitCount = 24, $mmioFOURCC = "MSVC")
    Local $RetArr[6] ; avi file handle, stream handle, bitmap count, BitmapInfoheader, Stride

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

    Local $aRet, $pFile, $asi, $aco, $pStream, $psCompressed

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

    Local $stride = BitAND(($Width * ($BitCount / 8) + 3), BitNOT(3))

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

    Local $bi = DllStructCreate($BITMAPINFOHEADER)
    DllStructSetData($bi, "biSize", DllStructGetSize($bi))
    DllStructSetData($bi, "biWidth", $Width)
    DllStructSetData($bi, "biHeight", $Height)
    DllStructSetData($bi, "biPlanes", 1)
    DllStructSetData($bi, "biBitCount", $BitCount)
    DllStructSetData($bi, "biSizeImage", $stride * $Height)

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

    $asi = DllStructCreate($AVISTREAMINFO)
    DllStructSetData($asi, "fccType", _Create_mmioFOURCC("vids"))
    DllStructSetData($asi, "fccHandler", _Create_mmioFOURCC($mmioFOURCC))
    DllStructSetData($asi, "dwScale", 1)
    DllStructSetData($asi, "dwRate", $FrameRate)
    DllStructSetData($asi, "dwQuality", -1) ;Quality is represented as a number between 0 and 10,000. For compressed data, this typically represents the value of the quality parameter passed to the compression software. If set to –1, drivers use the default quality value.
    DllStructSetData($asi, "dwSuggestedBufferSize", $stride * $Height)
    DllStructSetData($asi, "rright", $Width)
    DllStructSetData($asi, "rbottom", $Height)

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

    $aco = DllStructCreate($AVICOMPRESSOPTIONS)
    DllStructSetData($aco, "fccType", _Create_mmioFOURCC("vids"))
    DllStructSetData($aco, "fccHandler", _Create_mmioFOURCC($mmioFOURCC))
    DllStructSetData($aco, "dwKeyFrameEvery", 10)

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

    $aRet = DllCall($Avi32_Dll, "int", "AVIFileOpenW", "ptr*", 0, "wstr", $sFilename, "uint", $OF_CREATE, "ptr", 0)
    $pFile = $aRet[1]

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

    $aRet = DllCall($Avi32_Dll, "int", "AVIFileCreateStream", "ptr", $pFile, "ptr*", 0, "ptr", DllStructGetPtr($asi))
    $pStream = $aRet[2]

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

    $aRet = DllCall($Avi32_Dll, "int_ptr", "AVISaveOptions", "hwnd", 0, "uint", BitOR($ICMF_CHOOSE_DATARATE, $ICMF_CHOOSE_KEYFRAME), "int", 1, "ptr*", $pStream, "ptr*", DllStructGetPtr($aco))
    If $aRet[0] <> 1 Then
    $RetArr[0] = $pFile
    $RetArr[1] = $pStream
    Sleep(50)
    Return SetError(1, 0, $RetArr)
    EndIf

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

    ConsoleWrite(_DecodeFOURCC(DllStructGetData($aco, "fccHandler")) & @CRLF)

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

    ;http://msdn.microsoft.com/en-us/library/…1(v=VS.85).aspx
    $aRet = DllCall($Avi32_Dll, "int", "AVIMakeCompressedStream", "ptr*", 0, "ptr", $pStream, "ptr", DllStructGetPtr($aco), "ptr", 0)
    If $aRet[0] <> $AVIERR_OK Then
    $RetArr[0] = $pFile
    $RetArr[1] = $pStream
    Return SetError(2, 0, $RetArr)
    EndIf
    $psCompressed = $aRet[1]

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

    ;~ ; The format for the stream is the same as BITMAPINFOHEADER
    $aRet = DllCall($Avi32_Dll, "int", "AVIStreamSetFormat", "ptr", $psCompressed, "long", 0, "ptr", DllStructGetPtr($bi), "long", DllStructGetSize($bi))

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

    $RetArr[0] = $pFile
    $RetArr[1] = $psCompressed
    $RetArr[2] = 0
    $RetArr[3] = $bi
    $RetArr[4] = $stride
    $RetArr[5] = $pStream
    Return $RetArr
    EndFunc ;==>_CreateAvi

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

    ; Adds a bitmap file to an already opened avi file.
    ; monoceres, Prog@ndy
    Func _AddHBitmapToAvi(ByRef $Avi_Handle, $hBitmap)
    Local $DC = _WinAPI_GetDC(0)
    Local $hDC = _WinAPI_CreateCompatibleDC($DC)
    _WinAPI_ReleaseDC(0, $DC)

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

    Local $OldBMP = _WinAPI_SelectObject($hDC, $hBitmap)
    Local $bits = DllStructCreate("byte[" & DllStructGetData($Avi_Handle[3], "biSizeImage") & "]")
    _WinAPI_GetDIBits($hDC, $hBitmap, 0, Abs(DllStructGetData($Avi_Handle[3], "biHeight")), DllStructGetPtr($bits), DllStructGetPtr($Avi_Handle[3]), 0)
    _WinAPI_SelectObject($hDC, $OldBMP)
    _WinAPI_DeleteDC($hDC)

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

    DllCall($Avi32_Dll, "int", "AVIStreamWrite", "ptr", $Avi_Handle[1], "long", $Avi_Handle[2], "long", 1, "ptr", DllStructGetPtr($bits), _
    "long", DllStructGetSize($bits), "long", $AVIIF_KEYFRAME, "ptr*", 0, "ptr*", 0)
    $Avi_Handle[2] += 1
    EndFunc ;==>_AddHBitmapToAvi

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

    ; Adds a bitmap file to an already opened avi file.
    Func _AddBitmapToAvi(ByRef $Avi_Handle, $sBitmap)
    Local $bm = LoadBitmap($sBitmap, True)
    DllCall($Avi32_Dll, "int", "AVIStreamWrite", "ptr", $Avi_Handle[1], "long", $Avi_Handle[2], "long", 1, "ptr", DllStructGetPtr($bm[2]), _
    "long", DllStructGetSize($bm[2]), "long", $AVIIF_KEYFRAME, "ptr*", 0, "ptr*", 0)
    $Avi_Handle[2] += 1
    EndFunc ;==>_AddBitmapToAvi

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

    ; Returns array with 3 elements
    ; [0]=BITMAPFILEHEADER
    ; [1]=BITMAPINFOHEADER
    ; [2]=Bitmap data buffer (if specified)
    Func LoadBitmap($sFilename, $LoadData = False)
    Local $RetArr[3]
    Local $byref
    Local $bih, $bfh, $buffer, $fhandle
    $bfh = DllStructCreate($BITMAPFILEHEADER)
    $bih = DllStructCreate($BITMAPINFOHEADER)
    $fhandle = _WinAPI_CreateFile($sFilename, 2, 2, 0, 0)
    _WinAPI_ReadFile($fhandle, DllStructGetPtr($bfh), DllStructGetSize($bfh), $byref)
    _WinAPI_ReadFile($fhandle, DllStructGetPtr($bih), DllStructGetSize($bih), $byref)
    $RetArr[0] = $bfh
    $RetArr[1] = $bih

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

    If Not $LoadData Then
    _WinAPI_CloseHandle($fhandle)
    Return $RetArr
    EndIf

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

    $buffer = DllStructCreate("byte[" & DllStructGetData($bfh, "size") - 54 & "]")
    $RetArr[2] = $buffer
    _WinAPI_ReadFile($fhandle, DllStructGetPtr($buffer), DllStructGetSize($buffer), $byref)
    _WinAPI_CloseHandle($fhandle)

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

    Return $RetArr
    EndFunc ;==>LoadBitmap

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

    ; Init the avi library
    Func _StartAviLibrary()
    $Avi32_Dll = DllOpen("Avifil32.dll")
    DllCall($Avi32_Dll, "none", "AVIFileInit")
    EndFunc ;==>_StartAviLibrary

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

    ; Release the library
    Func _StopAviLibrary()
    DllCall($Avi32_Dll, "none", "AVIFileExit")
    DllClose($Avi32_Dll)
    EndFunc ;==>_StopAviLibrary

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

    Func _CloseAvi($Avi_Handle)
    DllCall($Avi32_Dll, "int", "AVIStreamRelease", "ptr", $Avi_Handle[1])
    DllCall($Avi32_Dll, "int", "AVIStreamRelease", "ptr", $Avi_Handle[5])
    DllCall($Avi32_Dll, "int", "AVIFileRelease", "ptr", $Avi_Handle[0])
    EndFunc ;==>_CloseAvi
    #endregion AVIWriter UD5

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

    #region example
    #include <Array.au3>
    #include <Memory.au3>
    #include <ScreenCapture.au3>

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

    _GDIPlus_Startup()
    HotKeySet("{ESC}", "close")

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

    Break(0)

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

    $sFile = @ScriptDir & "\test.avi"
    FileDelete($sFile)

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

    $tPoint = DllStructCreate($tagPOINT)
    $aMPos = MouseGetPos()
    DllStructSetData($tPoint, 1, $aMPos[0])
    DllStructSetData($tPoint, 2, $aMPos[1])
    $hWin = _WinAPI_WindowFromPoint($tPoint)
    $hWinAncestor = _WinAPI_GetAncestor($hWin, 2)
    $hWnd = HWnd($hWinAncestor)
    $aPos = WinGetPos($hWnd)

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

    $rec_duration = 1000 * 1

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

    ConsoleWrite("Starting...." & @CRLF)

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

    _StartAviLibrary()
    $aAVI = _CreateAvi($sFile, 15, $aPos[2], $aPos[3])
    If @error Then close()

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

    $t = TimerInit()

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

    Do
    $hBmp = _ScreenCapture_CaptureWnd("", $hWnd)
    $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp)
    _AddHBitmapToAvi($aAVI, $hBmp)
    _WinAPI_DeleteObject($hBmp)
    If TimerDiff($t) > $rec_duration Then close()
    Until False

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

    Func Close()
    _GDIPlus_Shutdown()
    _CloseAvi($aAVI)
    _StopAviLibrary()
    ConsoleWrite("AVI filesize: " & Round(FileGetSize($sFile) / 1024 ^ 2, 2) & " MB" & @CRLF)
    Exit
    EndFunc ;==>close
    #endregion example

    [/autoit]

    Gruß,
    UEZ

  • String auslesen und verwerten

    • UEZ
    • 14. September 2011 um 22:05

    Wie sieht der Text genau aus?

    Gruß,
    UEZ

  • StringRegExp zwischen Subject und zeilenumbruch.

    • UEZ
    • 14. September 2011 um 15:31

    Oder in SEuBo's Signatur schauen... ;)

    ich wusste, das da doch was war.

    Gruß,
    UEZ

  • StringRegExp zwischen Subject und zeilenumbruch.

    • UEZ
    • 14. September 2011 um 13:58

    Kannst du die Mail Datei hochladen? Denn mit dem Text von oben bekomme ich Test in dem Array zurück!

    Gruß,
    UEZ

  • StringRegExp zwischen Subject und zeilenumbruch.

    • UEZ
    • 14. September 2011 um 13:25

    Probiere es mal mit:

    [autoit]


    $StringR = StringRegExp($recv, '(?i)Subject:\s+(.*)\n',3)

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