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

Beiträge von eukalyptus

  • Sporadischer Fehler im Quelltext nach Kompilieren

    • eukalyptus
    • 13. Januar 2011 um 09:50

    Du kannst es mal mit Another AutoIt PreProcessor versuchen
    Nur [Insert Includes] und [optimize code / combine "_" - splited lines] auswählen.
    Dann sollte der neue Quelltext dem in der EXE entsprechen

    Es sei denn, du hast beim Compilieren den Obfuscator benutzt, oder eine ältere AutoIt Version - dann stimmen die Zeilen nur mehr ungefähr

    E

  • Devcon - Unverständliche Rückgabeparamter

    • eukalyptus
    • 12. Januar 2011 um 23:44

    Wenn du $STDERR_MERGED verwendest, dann wird auch der Error-Output nach StdOut geschrieben, d.h $msg_err wird immer leer bleiben und die Fehlermeldungen stehen in $msg
    Wenn du das getrennt haben willst, dann BitOR($STDOUT_CHILD, $STDERR_CHILD) verwenden.

    E

  • Via GDI+ Matrix normale Arrays transformieren

    • eukalyptus
    • 12. Januar 2011 um 18:10
    Zitat von UEZ

    ...aber irgendwie kommt mir das mit den Buchstaben bekannt vor...

    Kein Script ist vor ihm sicher,
    Eukalyptus ist: Der Plagiator! - demnächst im Kino :D

  • Via GDI+ Matrix normale Arrays transformieren

    • eukalyptus
    • 12. Januar 2011 um 17:36

    Und dann hätte ich da noch ein etwas aufwändigeres Beispiel ^^

    Spoiler anzeigen
    [autoit]

    #include "GDIP.au3"
    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    #include <String.au3>
    #include <WindowsConstants.au3>

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

    Opt("GUIOnEventMode", 1)

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

    Global $sText = "GDI+ Example by Eukalyptus....."
    $sText = _StringReverse($sText)

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

    Global $iW = 500
    Global $iH = 400

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

    Global Const $PI = ATan(1) * 4
    Global Const $DegToRad = $PI / 180

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

    _GDIPlus_Startup()
    Global $hGui = GUICreate("Test", $iW, $iH)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_EXIT")
    Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
    Global $hBmpBuffer = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
    Global $hGfxBuffer = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer)
    _GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer, 2)

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

    Global $hBmpFade = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
    Global $hGfxFade = _GDIPlus_ImageGetGraphicsContext($hBmpFade)
    _GDIPlus_GraphicsSetSmoothingMode($hGfxFade, 2)
    Global $fTransform = -0.01
    _GDIPlus_GraphicsTranslateTransform($hGfxFade, -($iW / 2 * $fTransform), -($iH / 2 * $fTransform))
    _GDIPlus_GraphicsScaleTransform($hGfxFade, 1 + $fTransform, 1 + $fTransform)
    _GDIPlus_GraphicsSetInterpolationMode($hGfxFade, 0)
    _GDIPlus_GraphicsClear($hGfxFade, 0xFF000000)
    GUIRegisterMsg($WM_PAINT, "WM_PAINT")
    GUISetState()

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

    Global $hPath = _GDIPlus_PathCreate()
    Global $aSplit = StringSplit($sText, "")
    Global $fX, $fY, $fA = 360 / $aSplit[0]
    For $i = 1 To $aSplit[0]
    $fX = Cos($i * $fA * $DegToRad) * $iH / 6
    $fY = Sin($i * $fA * $DegToRad) * $iH / 6
    _GDIPlus_PathAddLine($hPath, $fX, $fY, $fX + 1, $fY)
    Next

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

    Global $hMatrixRotate = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixRotate($hMatrixRotate, 1)

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

    Global $hMatrixRotate2 = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrixRotate2, 1, 1)
    _GDIPlus_MatrixRotate($hMatrixRotate2, 0.6)
    _GDIPlus_MatrixTranslate($hMatrixRotate2, -1, -1)

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

    Global $tScale = DllStructCreate("float[4]")
    Global $pScale = DllStructGetPtr($tScale)
    DllStructSetData($tScale, 1, 1, 1)
    DllStructSetData($tScale, 1, 0, 2)
    DllStructSetData($tScale, 1, 0, 3)
    DllStructSetData($tScale, 1, 2, 4)

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

    Global $hMatrixRotate3 = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixRotate($hMatrixRotate3, 0.8)

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

    Global $tPulse = DllStructCreate("float[2]")
    Global $pPulse = DllStructGetPtr($tPulse)
    DllStructSetData($tPulse, 1, 1, 1)
    DllStructSetData($tPulse, 1, 0, 2)

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

    Global $hPen = _GDIPlus_PenCreate(0xFF00FF00)
    Global $hBrush = _GDIPlus_BrushCreateSolid(0x40000000)

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

    Global $hFormat = _GDIPlus_StringFormatCreate()
    Global $hFamily = _GDIPlus_FontFamilyCreate("Arial")
    Global $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0)

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

    While 1
    _GDIPlus_GraphicsDrawImage($hGfxBuffer, $hBmpFade, 0, 0)
    _Draw()
    _GDIPlus_GraphicsDrawImage($hGfxFade, $hBmpBuffer, 0, 0)
    _GDIPlus_GraphicsFillRect($hGfxFade, 0, 0, $iW, $iH, $hBrush)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
    Sleep(10)
    WEnd

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

    Func _Draw()
    _GDIPlus_PathTransform($hPath, $hMatrixRotate)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipGetPointCount", "hwnd", $hPath, "int*", 0)
    Local $iCount = $aResult[2]
    Local $tPoints = DllStructCreate("float[" & $iCount * 2 & "]")
    Local $pPoints = DllStructGetPtr($tPoints)
    DllCall($ghGDIPDll, "uint", "GdipGetPathPoints", "hwnd", $hPath, "ptr", $pPoints, "int", $iCount)

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

    DllCall($ghGDIPDll, "uint", "GdipTransformMatrixPoints", "hwnd", $hMatrixRotate2, "ptr", $pScale, "int", 2)
    Local $hMatrixScale = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixScale($hMatrixScale, 1 + DllStructGetData($tScale, 1, 1), 1 + DllStructGetData($tScale, 1, 4))
    DllCall($ghGDIPDll, "uint", "GdipTransformMatrixPoints", "hwnd", $hMatrixScale, "ptr", $pPoints, "int", $iCount)
    _GDIPlus_MatrixDispose($hMatrixScale)

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

    DllCall($ghGDIPDll, "uint", "GdipTransformMatrixPoints", "hwnd", $hMatrixRotate3, "ptr", $pPulse, "int", 1)
    Local $fSize = Abs(DllStructGetData($tPulse, 1, 1))
    $hMatrixScale = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixScale($hMatrixScale, $fSize, $fSize)
    DllCall($ghGDIPDll, "uint", "GdipTransformMatrixPoints", "hwnd", $hMatrixScale, "ptr", $pPoints, "int", $iCount)
    _GDIPlus_MatrixDispose($hMatrixScale)

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

    Local $hPathDraw = _GDIPlus_PathCreate()
    Local $fX, $fY
    $fSize *= $iH / $aSplit[0] * 4
    For $i = 1 To $aSplit[0]
    $fX = DllStructGetData($tPoints, 1, ($i - 1) * 4 + 1) + $iW / 2
    $fY = DllStructGetData($tPoints, 1, ($i - 1) * 4 + 2) + $iH / 2
    DllStructSetData($tLayout, 1, $fX)
    DllStructSetData($tLayout, 2, $fY)
    _GDIPlus_PathAddString($hPathDraw, $aSplit[$i], $tLayout, $hFamily, 0, $fSize, $hFormat)
    Next

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

    _GDIPlus_GraphicsDrawPath($hGfxBuffer, $hPathDraw, $hPen)
    _GDIPlus_PathDispose($hPathDraw)
    EndFunc ;==>_Draw

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

    Func WM_PAINT($hWnd, $uMsgm, $wParam, $lParam)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_PAINT

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

    Func _Exit()
    _GDIPlus_PathDispose($hPath)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_MatrixDispose($hMatrixRotate)
    _GDIPlus_MatrixDispose($hMatrixRotate2)
    _GDIPlus_GraphicsDispose($hGfxFade)
    _GDIPlus_BitmapDispose($hBmpFade)
    _GDIPlus_GraphicsDispose($hGfxBuffer)
    _GDIPlus_BitmapDispose($hBmpBuffer)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>_Exit

    [/autoit]
  • Via GDI+ Matrix normale Arrays transformieren

    • eukalyptus
    • 12. Januar 2011 um 15:09

    Hi

    In der GDIp.au3 gibt es die Funktion _GDIPlus_MatrixTransformPoints
    damit kann man z.B. Koordinaten, die sich in einem normalen Array befinden mit einer GDI+Matrix multiplizieren
    Kann manchmal ganz nützlich sein

    Hier ein kurzes Beispiel:

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>

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

    HotKeySet("{ESC}", "_Exit")

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

    Global Const $PI = ATan(1) * 4
    Global Const $DegToRad = $PI / 180

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

    Global $aPoints[10][2]
    $aPoints[0][0] = 9
    For $i = 1 To 9
    $aPoints[$i][0] = Cos($i * 40 * $DegToRad) * 200 + 400
    $aPoints[$i][1] = Sin($i * 40 * $DegToRad) * 200 + 300
    Next

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

    Global $aGui[10]
    For $i = 1 To 9
    $aGui[$i] = GUICreate("", 100, 100, $aPoints[$i][0], $aPoints[$i][1])
    GUISetState()
    Next

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

    _GDIPlus_Startup()
    Global $hMatrixRotate = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrixRotate, 400, 300)
    _GDIPlus_MatrixRotate($hMatrixRotate, 1)
    _GDIPlus_MatrixTranslate($hMatrixRotate, -400, -300)

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

    Global $hMatrixScale = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrixScale, 400, 300)
    _GDIPlus_MatrixScale($hMatrixScale, 2, 1)
    _GDIPlus_MatrixTranslate($hMatrixScale, -400, -300)

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

    Global $aPointsNew

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

    While 1
    $aPoints = _GDIPlus_MatrixTransformPoints($hMatrixRotate, $aPoints)
    $aPointsNew = _GDIPlus_MatrixTransformPoints($hMatrixScale, $aPoints)
    For $i = 1 To $aPointsNew[0][0]
    WinMove($aGui[$i], "", $aPointsNew[$i][0], $aPointsNew[$i][1], 100, 100)
    Next
    Sleep(10)
    WEnd

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

    Func _Exit()
    _GDIPlus_MatrixDispose($hMatrixRotate)
    _GDIPlus_MatrixDispose($hMatrixScale)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>_Exit

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_MatrixTransformPoints
    ; Description ...: Multiplies each point in an array by a matrix
    ; Syntax.........: _GDIPlus_MatrixTransformPoints($hMatrix, $aPoints)
    ; Parameters ....: $hMatrix - Pointer to a Matrix object
    ; $aPoints - Array of points to be transformed:
    ; |[0][0] - Number of points
    ; |[1][0] - Point 1 X coordinate
    ; |[1][1] - Point 1 Y coordinate
    ; |[2][0] - Point 2 X coordinate
    ; |[2][1] - Point 2 Y coordinate
    ; |[n][0] - Point n X coordinate
    ; |[n][1] - Point n Y coordinate
    ; Return values .: Success - Array containing the transformed points:
    ; |[0][0] - Number of points
    ; |[1][0] - Transformed point 1 X coordinate
    ; |[1][1] - Transformed point 1 Y coordinate
    ; |[2][0] - Transformed point 2 X coordinate
    ; |[2][1] - Transformed point 2 Y coordinate
    ; |[n][0] - Transformed point n X coordinate
    ; |[n][1] - Transformed point n Y coordinate
    ; Failure - -1 and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: Each point in the array is treated as a row matrix. The multiplication is performed with the row matrix on the
    ; +left and the matrix on the right
    ; Related .......: _GDIPlus_MatrixTransformPointsI
    ; Link ..........; @@MsdnLink@@ GdipTransformMatrixPoints
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_MatrixTransformPoints($hMatrix, $aPoints)
    Local $iI, $iCount, $tPoints, $pPoints, $aResult

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

    $iCount = $aPoints[0][0]
    $tPoints = DllStructCreate("float[" & $iCount * 2 & "]")
    $pPoints = DllStructGetPtr($tPoints)

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

    For $iI = 1 To $iCount
    DllStructSetData($tPoints, 1, $aPoints[$iI][0], ($iI - 1) * 2 + 1)
    DllStructSetData($tPoints, 1, $aPoints[$iI][1], ($iI - 1) * 2 + 2)
    Next

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipTransformMatrixPoints", "hwnd", $hMatrix, "ptr", $pPoints, "int", $iCount)
    If @error Then Return SetError(@error, @extended, -1)

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

    $GDIP_STATUS = $aResult[0]
    If $GDIP_STATUS Then Return -1

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

    For $iI = 1 To $iCount
    $aPoints[$iI][0] = DllStructGetData($tPoints, 1, ($iI - 1) * 2 + 1)
    $aPoints[$iI][1] = DllStructGetData($tPoints, 1, ($iI - 1) * 2 + 2)
    Next

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

    Return $aPoints
    EndFunc ;==>_GDIPlus_MatrixTransformPoints

    [/autoit]

    Bei großen Arrays sollte man gleich DllStructs statt Arrays verwenden, damit nicht jedesmal umgewandelt werden muß...

    E

  • Glow- bzw. Lichteffekt!?

    • eukalyptus
    • 10. Januar 2011 um 20:20

    Eine LED besteht (in meinem Beispiel) aus 2 Ellipsen; eine für Glow und eine für LED
    Bei beiden kannst du die Farbe selber angeben
    _GDIPlus_PathBrushSetCenterColor = Farbe im Mittelpunkt
    _GDIPlus_PathBrushSetSurroundColorsWithCount = Farbe am Rand

    Wenn du da etwas herumprobierst, wirst du selber eine weiße LED hinbekommen ^^

    E

    EDIT: bei _HSLAtoARGB kann man auch Saturation angeben; sollten Werte von 0-1 sein

  • BASS.dll in datei streamen

    • eukalyptus
    • 10. Januar 2011 um 19:48

    Eine relativ aktuelle Version von BassExt.dll sollte hier mit dabei sein: Audio Visualization Collection

    [autoit]

    $hStream = _BASS_StreamCreateURL($sUrl, 0, 0, $BASS_EXT_DownloadProc, 0) ;use callback function from bassext.dll

    [/autoit][autoit]

    $hEncoder=_BASS_Encode_Start($hStream, 'lame -r -x -b128 -h - "' & @MyDocumentsDir & '\_BASS_ENCODE_EXAMPLE.mp3"', 0)

    [/autoit]


    oder

    [autoit]

    $hEncoder = _BASS_Encode_Start($hRecord, @MyDocumentsDir & "\BASS_EXAMPLE.wav", $BASS_ENCODE_PCM)

    [/autoit]


    sollte funktionieren

  • Screenshot von Web Seiten

    • eukalyptus
    • 10. Januar 2011 um 19:39
    Zitat von MatthiasG.

    Ich hatte vor längerer Zeit ein nettes Programm, dass bei Fenstern allgemein einen Screenshot erstellt hat, automagisch etwas herunter gescrollt hat und den nächsten gemacht hat und die Bilder dann zusammengesetzt hat. Vielleicht ist das einfacher?

    Gruß,
    Matthias

    meinst du das ;) [ gelöst ] kompletter Screenshot einer Webseite

    UEZ versucht doch gerade ohne Scrollen auszukommen!

  • Glow- bzw. Lichteffekt!?

    • eukalyptus
    • 10. Januar 2011 um 19:33

    hier der original Link zu GDIp.au3: http://www.autoitscript.com/forum/topic/10…post__p__748870

    Hier eine Version, die alle Farben und Helligkeiten kann:

    Spoiler anzeigen
    [autoit]

    #include "GDIP.au3"
    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>

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

    Global $iLS = 20

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

    Opt("GUIOnEventMode", 1)

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

    Global $hGui = GUICreate("LED", $iLS * 6, $iLS * 2 + 200)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    Global $cDummyHUE = GUICtrlCreateDummy()
    For $i = 0 To 4
    GUICtrlCreateSlider($iLS * $i + $iLS / 2, $iLS * 2 + 10, 20, 90, 0x0002)
    GUICtrlSetData(-1, $i * 20)
    Next
    Global $cDummyLIG = GUICtrlCreateDummy()
    For $i = 0 To 4
    GUICtrlCreateSlider($iLS * $i + $iLS / 2, $iLS * 2 + 100, 20, 90, 0x0002)
    Next
    GUISetState()

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

    _GDIPlus_Startup()
    Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
    Global $hBmpBuffer = _GDIPlus_BitmapCreateFromGraphics($iLS * 6, $iLS * 2, $hGraphics)
    Global $hGfxBuffer = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer)
    _GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer, 2)

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

    While 1
    _GDIPlus_GraphicsClear($hGfxBuffer, 0xFF000000)
    For $i = 0 To 4
    _DrawLED($i)
    Next
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
    Sleep(50)
    WEnd

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

    Func _DrawLED($iI)
    Local $iHUE = GUICtrlRead($cDummyHUE + $iI + 1) / 100
    Local $iLIG = 0.5 - GUICtrlRead($cDummyLIG + $iI + 1) / 200
    Local $iColor = _HSLAtoARGB($iHUE, 1, $iLIG, 1)
    Local $iColor2 = BitOR(BitShift($iLIG * 2 * 0xFF, -24), 0x00FFFFFF)
    If $iI = 0 Then ConsoleWrite(Hex($iColor2) & @CRLF)
    Local $hPath = _GDIPlus_PathCreate()
    _GDIPlus_PathAddEllipse($hPath, $iI * $iLS, 0, $iLS * 2, $iLS * 2)
    Local $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath)
    _GDIPlus_PathBrushSetSigmaBlend($hBrush, 0.5, 0.7)
    _GDIPlus_PathBrushSetCenterColor($hBrush, $iColor)
    Local $aColor[2] = [1, 0x00FFFFFF]
    _GDIPlus_PathBrushSetSurroundColorsWithCount($hBrush, $aColor)
    _GDIPlus_PathDispose($hPath)
    _GDIPlus_GraphicsFillEllipse($hGfxBuffer, $i * $iLS, 0, $iLS * 2, $iLS * 2, $hBrush)
    _GDIPlus_BrushDispose($hBrush)

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

    $hPath = _GDIPlus_PathCreate()
    _GDIPlus_PathAddEllipse($hPath, $iI * $iLS + $iLS / 2, $iLS / 2, $iLS, $iLS)
    $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath)
    _GDIPlus_PathBrushSetSigmaBlend($hBrush, 1, 0.6)
    _GDIPlus_PathBrushSetGammaCorrection($hBrush, True)
    _GDIPlus_PathBrushSetCenterPoint($hBrush, $iI * $iLS + $iLS * 0.9, $iLS * 0.9)
    _GDIPlus_PathBrushSetCenterColor($hBrush, $iColor2)
    Local $aColor[2] = [1, $iColor]
    _GDIPlus_PathBrushSetSurroundColorsWithCount($hBrush, $aColor)
    _GDIPlus_PathDispose($hPath)
    _GDIPlus_GraphicsFillEllipse($hGfxBuffer, $i * $iLS, 0, $iLS * 2, $iLS * 2, $hBrush)
    _GDIPlus_BrushDispose($hBrush)
    EndFunc ;==>_DrawLED

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

    Func _HSLAtoARGB($nH, $nS, $nL, $nA)
    Local $nR, $nG, $nB
    Local $nValB = $nL * ($nS + 1)
    Local $nValA = 2 * $nL - $nValB

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

    $nR = _HueToRGB($nValA, $nValB, $nH + 1 / 3)
    $nG = _HueToRGB($nValA, $nValB, $nH)
    $nB = _HueToRGB($nValA, $nValB, $nH - 1 / 3)

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

    Return BitOR(BitShift($nA * 0xFF, -24), BitShift($nR * 0xFF, -16), BitShift($nG * 0xFF, -8), $nB * 0xFF)
    EndFunc ;==>_HSLAtoARGB

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

    Func _HueToRGB($nA, $nB, $nH)
    If $nH < 0 Then $nH += 1
    If $nH > 1 Then $nH -= 1

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

    If (6 * $nH) < 1 Then Return $nA + ($nB - $nA) * 6 * $nH
    If (2 * $nH) < 1 Then Return $nB
    If (3 * $nH) < 2 Then Return $nA + ($nB - $nA) * 6 * (2 / 3 - $nH)
    Return $nA
    EndFunc ;==>_HueToRGB

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

    Func WM_PAINT($hWnd, $uMsgm, $wParam, $lParam)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_PAINT

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

    Func _Exit()
    _GDIPlus_GraphicsDispose($hGfxBuffer)
    _GDIPlus_BitmapDispose($hBmpBuffer)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    E

  • Screenshot von Web Seiten

    • eukalyptus
    • 10. Januar 2011 um 18:34

    Hab etwas herumprobiert und noch keine Lösung für XP gefunden.

    Es schein, daß Fensterteile, die außerhalb des Bildschrims liegen nicht erfasst werden. weder mit BitBlt, noch via WM_PRINTCLIENT hatte ich Erfolg.

    Bei Gelegenheit werd ich weiterforschen ;)

    E

  • Glow- bzw. Lichteffekt!?

    • eukalyptus
    • 10. Januar 2011 um 18:27

    Mit den PathBrush-Funktionen kann man einiges machen:

    Spoiler anzeigen
    [autoit]

    #include "GDIP.au3"
    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>

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

    Global $iLX = 40
    Global $iLY = 20
    Global $iLS = 20

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

    Opt("GUIOnEventMode", 1)

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

    Global $hGui = GUICreate("LED", $iLX * $iLS, $iLY * $iLS)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    GUISetState()

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

    _GDIPlus_Startup()
    Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)

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

    Global $hBmpBuffer = _GDIPlus_BitmapCreateFromGraphics($iLX * $iLS, $iLY * $iLY, $hGraphics)
    Global $hGfxBuffer = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer)
    _GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer, 2)

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

    Global $hBmpLED_ON = _CreateLED($hGraphics, $iLS, 0xFFFFFFFF, 0xFF00FF00, True)
    Global $hBmpLED_OFF = _CreateLED($hGraphics, $iLS, 0xFF777777, 0x88066000, False)

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

    While 1
    _GDIPlus_GraphicsClear($hGfxBuffer, 0xFF000000)
    For $x = 0 To $iLX - 1
    For $y = 0 To $iLY - 1
    _GDIPlus_GraphicsDrawImage($hGfxBuffer, $hBmpLED_OFF, $x * $iLS - $iLS / 2, $y * $iLS - $iLS / 2)
    Next
    Next
    For $x = 0 To $iLX - 1
    For $y = 0 To $iLY - 1
    If Random(0, 2, 1) = 1 Then _GDIPlus_GraphicsDrawImage($hGfxBuffer, $hBmpLED_ON, $x * $iLS - $iLS / 2, $y * $iLS - $iLS / 2)
    Next
    Next
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
    Sleep(1000)
    WEnd

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

    Func _CreateLED($hGraphics, $iLS, $iColor1 = 0xFFFFFFFF, $iColor2 = 0xFF00FF00, $bOn = True)
    Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iLS * 2, $iLS * 2, $hGraphics)
    Local $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hContext, 2)

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

    If $bOn Then
    Local $hPath = _GDIPlus_PathCreate()
    _GDIPlus_PathAddEllipse($hPath, 0, 0, $iLS * 2, $iLS * 2)
    Local $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath)
    _GDIPlus_PathBrushSetSigmaBlend($hBrush, 0.6, 0.7)
    _GDIPlus_PathBrushSetCenterColor($hBrush, $iColor2)
    Local $aColor[2] = [1, 0x00FFFFFF]
    _GDIPlus_PathBrushSetSurroundColorsWithCount($hBrush, $aColor)
    _GDIPlus_PathDispose($hPath)

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

    _GDIPlus_GraphicsFillEllipse($hContext, 0, 0, $iLS * 2, $iLS * 2, $hBrush)
    _GDIPlus_BrushDispose($hBrush)
    EndIf

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

    $hPath = _GDIPlus_PathCreate()
    _GDIPlus_PathAddEllipse($hPath, $iLS / 2, $iLS / 2, $iLS, $iLS)
    $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath)
    _GDIPlus_PathBrushSetSigmaBlend($hBrush, 1, 0.6)
    _GDIPlus_PathBrushSetGammaCorrection($hBrush, True)
    _GDIPlus_PathBrushSetCenterPoint($hBrush, $iLS * 0.9, $iLS * 0.9)
    _GDIPlus_PathBrushSetCenterColor($hBrush, $iColor1)
    Local $aColor[2] = [1, $iColor2]
    _GDIPlus_PathBrushSetSurroundColorsWithCount($hBrush, $aColor)
    _GDIPlus_PathDispose($hPath)

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

    _GDIPlus_GraphicsFillEllipse($hContext, $iLS / 2, $iLS / 2, $iLS, $iLS, $hBrush)
    _GDIPlus_BrushDispose($hBrush)

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

    _GDIPlus_GraphicsDispose($hContext)
    Return $hBitmap
    EndFunc ;==>_CreateLED

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

    Func WM_PAINT($hWnd, $uMsgm, $wParam, $lParam)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_PAINT

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

    Func _Exit()
    _GDIPlus_BitmapDispose($hBmpLED_ON)
    _GDIPlus_BitmapDispose($hBmpLED_OFF)

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

    _GDIPlus_GraphicsDispose($hGfxBuffer)
    _GDIPlus_BitmapDispose($hBmpBuffer)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    Die GDIp.au3 wird benötigt - findest du im Forum.
    schau dir auch noch die restlichen PathBrush-Funktionen an, und probier sie aus um evtl. bessere Effekte zu erreichen

    E

  • Screenshot von Web Seiten

    • eukalyptus
    • 10. Januar 2011 um 11:43

    Bei mir kommt ein schwarzes Bild raus!
    Wenn ich WinMove (Zeile 79) deaktiviere, dann erhalte ich ein Bild der Webseite, allerdings incl. SplashText und Taskleiste...

    WinXP SP3
    Auf Win7 hab ich es noch nicht probiert

    E

  • Autoit Mp3 DJ

    • eukalyptus
    • 8. Januar 2011 um 07:20

    Ich habe tatsächlich vor, dieses Programm nochmals anzugehen... allerdings komplett neu
    (irgendwann mal ;))

  • Array um 90° Drehen

    • eukalyptus
    • 8. Januar 2011 um 07:15

    Hier:

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>

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

    Global $aArray[3][3] = [[0, 1, 2],[3, 4, 5],[6, 7, 8]]
    ;Global $aArray[4][3] = [[0, 1, 2],[3, 4, 5],[6, 7, 8],[9, 10, 11]]
    _ArrayDisplay($aArray)
    _Array2DRotate($aArray, 0)
    _ArrayDisplay($aArray)

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

    Func _Array2DRotate(ByRef $aArray, $iClockwise = True)
    If UBound($aArray, 0) <> 2 Then Return SetError(1, 0, False)
    Local $iDim1 = UBound($aArray, 1)
    Local $iDim2 = UBound($aArray, 2)
    Local $aNew[$iDim2][$iDim1]
    Switch $iClockwise
    Case True
    For $i = 0 To $iDim1 - 1
    For $j = 0 To $iDim2 - 1
    $aNew[$iDim2 - $j - 1][$i] = $aArray[$i][$j]
    Next
    Next
    Case Else
    For $i = 0 To $iDim1 - 1
    For $j = 0 To $iDim2 - 1
    $aNew[$j][$iDim1 - $i - 1] = $aArray[$i][$j]
    Next
    Next
    EndSwitch
    $aArray = $aNew
    Return True
    EndFunc ;==>_Array2DRotate

    [/autoit]

    Für BlockOut musste ich das mit einem 3D Array machen :D

    E

  • Exchange Variables UDF Beta

    • eukalyptus
    • 3. Januar 2011 um 10:08

    Danke für die Info!

    Ich werde mir das mal ansehen, wenn ich Zeit hab.

    E

  • Radio über Bass.au3 spielen

    • eukalyptus
    • 31. Dezember 2010 um 17:43
    Zitat von Higggiii

    ...Für alle die es interessiert, $__translate ist der Wert mit dem man den Rückgabewert von BASS_GetChannelPosition/ChannelGetLength, multiplizieren muss um den Millisekunden Wert zu erhalten...

    Ich muss dich leider enttäuschen, das kann so nicht funktionieren!
    Wieviele Bytes nun wieviele Sekunden ergeben ist abhängig von der Samplingfrequenz, der Auflösung und der Anzahl der Kanäle.
    Deshalb gibt es auch die Funktion _BASS_ChannelBytes2Seconds, die dann den genauen Wert ausrechnet.
    (Deine Methode funktioniert nur bei 44100KHz/16Bit/Mono)

    lgE

  • Tasten Abhorchen

    • eukalyptus
    • 23. Dezember 2010 um 21:42

    Ich empfehle _WinApi_GetKeyboardState (WinAPIEx.au3)

    Damit bekommt man mit nur einem einzigen Aufruf alle Tasten abgefragt.
    Weiters sieht man an den Werten auch, ob zwischen 2 Abfragen eine Taste gedrückt wurde (Toogle).
    Und: diese Funktion lässt sich nicht als Keylogger mißbrauchen, denn sie funktioniert nur bei eigenen Fenstern ;)

    E

  • GUI Button mit Pfeiltasten selectieren?

    • eukalyptus
    • 23. Dezember 2010 um 14:53

    Das geht, aber manchmal will man eben nicht alle Controls auswählbar haben...

    Du kannst dir mit zwei Dummycontrols helfen, einer vor und einer nach den auszuwählenden Controls (alle anderen Controls davor oder nachher erstellen)

    z.B.:

    [autoit]

    $cDummy1 = GUICtrlCreateDummy()
    GUICtrlCreateButton("Button 1", 10, 10, 200, 20)
    GUICtrlCreateButton("Button 2", 10, 40, 200, 20)
    GUICtrlCreateButton("Button 3", 10, 70, 200, 20)
    GUICtrlCreateButton("Button 4", 10, 100, 200, 20)
    GUICtrlCreateButton("Button 5", 10, 130, 200, 20)
    $cDummy2 = GUICtrlCreateDummy()

    [/autoit]

    dann

    [autoit]

    HotKeySet("{Up}", "_Select")
    HotKeySet("{Down}", "_Select")

    [/autoit][autoit]

    Func _Select()
    Switch @HotKeyPressed
    Case "{Up}"
    $iSelect -= 1
    Case "{Down}"
    $iSelect += 1
    EndSwitch
    If $iSelect <= $cDummy1 Then $iSelect = $cDummy2 - 1
    If $iSelect >= $cDummy2 Then $iSelect = $cDummy1 + 1
    GUICtrlSetState($iSelect, $GUI_FOCUS)
    EndFunc ;==>_Select

    [/autoit]

    E

  • Diskussion über Anfangsmoderation

    • eukalyptus
    • 23. Dezember 2010 um 14:35

    Vielleicht schreckt es ab, aber das is doch auch gut so.
    Es bleiben uns nur die neuen User erhalten, die sich höflich und deutlich ausdrücken können und nicht gleich an die Decke gehen, wenn sie nicht sofort die erwünschte Hilfe bekommen.
    Diese User werden sich dann später auch als Helfer erweisen.

    Egal ob nun Bot oder nicht (das find ich persönlich eigentlich nebensächlich), das aktuelle System filtert die User nach deren Charakter.
    Und meistens sind es eben die Botter, die nicht durchkommen :P

    Qualität vor Quantität!

    E

  • Kleiner Wettbewerb von mir: Stereogramme

    • eukalyptus
    • 22. Dezember 2010 um 19:45

    Hi

    Ich finde die Idee wirklich toll!
    aber es wäre besser, das als Aufgabe für den nächsten µIt zu nehmen, also dann im Feb.
    damit nicht mehrere Wettbewerbe gleichzeitig laufen.

    E

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™