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

  • GDI+ Buchstaben Rotation

    • UEZ
    • 8. April 2011 um 20:53
    Zitat von Dietmar

    Nabend bekomme bei einem Script

    Aber was man bis da sehen konnte ist schon sehr beeindruckend. :D
    Besonders das Ballet

    Eukalyptus' Funktion dient dazu den Bug in der Warp Funktion zu korrigieren!

    Folgende Funktion ist die korrekte Funktion!

    [autoit]


    Func _GDIPlus_PathWarp($hPath, $hMatrix, $aPoints, $nX, $nY, $nWidth, $nHeight, $iWarpMode = 0, $nFlatness = $FlatnessDefault)
    Local $iI, $iCount, $pPoints, $tPoints, $aResult

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

    $iCount = $aPoints[0][0]
    If $iCount <> 3 And $iCount <> 4 Then
    $GDIP_ERROR = 1
    Return False
    EndIf

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

    $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", "GdipWarpPath", "hwnd", $hPath, "hwnd", $hMatrix, "ptr", $pPoints, "int", $iCount, "float", $nX, "float", $nY, "float", $nWidth, "float", $nHeight, "int", $iWarpMode, "float", $nFlatness)
    If @error Then Return SetError(@error, @extended, False)

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

    $GDIP_STATUS = $aResult[0]
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_PathWarp

    [/autoit]

    Am besten diese Funktion in der GDIp.au3 suchen und ersetzen, da ansonsten der Effekt nicht funzt!

    Gruß,
    UEZ

  • GDI+ Buchstaben Rotation

    • UEZ
    • 8. April 2011 um 20:02

    Hier 3 kleine Beispiele (2x von mir und 1x von Eukalyptus):

    Rotated Letters by Eukalyptus:

    Spoiler anzeigen
    [autoit]


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

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

    _CheckGDIpWarpBug("GDIp.au3")

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

    Opt("GUIOnEventMode", 1)

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

    _GDIPlus_Startup()

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

    $iW = 600
    $iH = 600

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

    $hGui = GUICreate("Test", $iW, $iH)
    GUISetOnEvent(-3, "_Exit")
    GUISetState()

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

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
    $hBmpBuffer = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
    $hGfxBuffer = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer)
    _GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer, 2)
    _GDIPlus_GraphicsClear($hGfxBuffer, 0xFF000000)

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

    $hBrush = _GDIPlus_BrushCreateSolid(0xFFFFAA00)
    $hBrushTrans = _GDIPlus_BrushCreateSolid(0x66000000)

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

    $sText = "Rotated Letters by Eukalyptus ;)"

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

    $hPath = _CreateTextPath($sText, 400, "Impact", 110)

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

    $hMatrix = _GDIPlus_MatrixCreate()

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

    GUIRegisterMsg($WM_PAINT, "WM_PAINT")
    GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND")

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

    Global $aPoints[5][2]
    $aPoints[0][0] = 4
    $aPoints[1][0] = $iW / 2 - $iW * 0.2
    $aPoints[1][1] = $iH / 2 - $iH * 0.2
    $aPoints[2][0] = $iW / 2 + $iW * 0.2
    $aPoints[2][1] = $iH / 2 - $iH * 0.2
    $aPoints[3][0] = 0
    $aPoints[3][1] = $iH
    $aPoints[4][0] = $iW
    $aPoints[4][1] = $iH

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

    While 1
    _RotateMatrix()

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

    $hPathClone = _GDIPlus_PathClone($hPath)
    _GDIPlus_PathTransform($hPathClone, $hMatrix)
    _GDIPlus_PathWarp($hPathClone, 0, $aPoints, 0, 0, $iW, $iH + $iH * 0.3)

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

    _GDIPlus_GraphicsFillRect($hGfxBuffer, 0, 0, $iW, $iH, $hBrushTrans)
    _GDIPlus_GraphicsFillPath($hGfxBuffer, $hPathClone, $hBrush)

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

    _GDIPlus_PathDispose($hPathClone)

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

    _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
    ;Sleep(10)
    WEnd

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

    Func _RotateMatrix()
    Local Static $iStep = 0
    $iStep += 0.003
    _GDIPlus_MatrixSetElements($hMatrix, 1, 0, 0, 1, 0, 0)
    _GDIPlus_MatrixTranslate($hMatrix, $iW / 2, $iH / 2)
    _GDIPlus_MatrixRotate($hMatrix, -(Sin($iStep) * 360))
    _GDIPlus_MatrixTranslate($hMatrix, -$iW / 2, -$iH / 2)
    EndFunc ;==>_RotateMatrix

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

    Func _CreateTextPath($sText, $iR, $sFont, $fSize)
    Local $hPath = _GDIPlus_PathCreate()

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

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

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

    Local $aSplit = StringSplit($sText, "")
    Local $aPath[$aSplit[0] + 1][2]
    Local $aBounds, $iLen = 0

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

    Local $hMatrix = _GDIPlus_MatrixCreate()

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

    For $i = 1 To $aSplit[0]
    $aPath[$i][0] = _GDIPlus_PathCreate()
    _GDIPlus_PathAddString($aPath[$i][0], $aSplit[$i], $tLayout, $hFamily, 0, $fSize, $hFormat)
    $aBounds = _GDIPlus_PathGetWorldBounds($aPath[$i][0])
    $aPath[$i][1] = $aBounds[2]
    If $aSplit[$i] = " " Then $aPath[$i][1] = $fSize / 3
    $iLen += $aPath[$i][1]
    _GDIPlus_MatrixTranslate($hMatrix, $iW / 2 - $aBounds[2], $iH / 2 - $iR)
    _GDIPlus_PathTransform($aPath[$i][0], $hMatrix)
    _GDIPlus_MatrixSetElements($hMatrix, 1, 0, 0, 1, 0, 0)
    Next

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

    For $i = 1 To $aSplit[0]
    _GDIPlus_MatrixTranslate($hMatrix, $iW / 2, $iH / 2)
    _GDIPlus_MatrixRotate($hMatrix, -($aPath[$i][1] * 340 / $iLen))
    _GDIPlus_MatrixTranslate($hMatrix, -$iW / 2, -$iH / 2)
    _GDIPlus_PathTransform($hPath, $hMatrix)

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

    _GDIPlus_PathAddPath($hPath, $aPath[$i][0], False)

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

    _GDIPlus_MatrixSetElements($hMatrix, 1, 0, 0, 1, 0, 0)
    Next

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

    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)

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

    _GDIPlus_MatrixDispose($hMatrix)
    For $i = 1 To $aSplit[0]
    _GDIPlus_PathDispose($aPath[$i][0])
    Next
    Return $hPath
    EndFunc ;==>_CreateTextPath

    [/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 WM_ERASEBKGND($hWnd, $uMsgm, $wParam, $lParam)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
    Return True
    EndFunc ;==>WM_ERASEBKGND

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

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

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

    Func _CheckGDIpWarpBug($sPath)
    If Not FileExists($sPath) Then
    MsgBox(0, "error", $sPath & " not found")
    Return
    EndIf
    Local $sSource = FileRead($sPath)
    Local $aRegExp = StringRegExp($sSource, "(?is)Func\h+_GDIPlus_PathWarp(.*?)EndFunc", 3)
    If Not IsArray($aRegExp) Then
    MsgBox(0, "error", "Func _GDIPlus_PathWarp not found in" & @CRLF & $sPath)
    Return
    EndIf
    If StringRegExp($aRegExp[0], "(?i)\$iCount\h+<>\h+3\h+Or") Then
    $sSource = StringLeft($sSource, StringInStr($sSource, "Func _GDIPlus_PathWarp"))
    $aRegExp[0] = StringLeft($aRegExp[0], StringInStr($aRegExp[0], "If $iCount <> 3"))
    Local $iLine = 1
    StringRegExpReplace($sSource, "\r", "")
    $iLine += @extended
    StringRegExpReplace($aRegExp[0], "\r", "")
    $iLine += @extended
    MsgBox(0, "error found", "error in " & $sPath & @CRLF & "change line " & $iLine & @CRLF & "If $iCount <> 3 Or $iCount <> 4 Then" & @CRLF & "to:" & @CRLF & "If $iCount <> 3 And $iCount <> 4 Then")
    EndIf
    EndFunc ;==>_CheckGDIpWarpBug

    [/autoit]

    Rotated Letters:

    Spoiler anzeigen
    [autoit]


    ;coded by UEZ 2011 build 2011-04-06
    ;~ #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_Obfuscated.au3"
    #AutoIt3Wrapper_UseUpx=y
    #AutoIt3Wrapper_UPX_Parameters=--brute --crp-ms=999999 --all-methods --all-filters

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

    #include <Array.au3>
    #include <GDIPlus.au3>
    Opt("GUIOnEventMode", 1)
    Opt("MustDeclareVars", 1)

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

    _GDIPlus_Startup()

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

    Global Const $iW = 600
    Global Const $iH = 600
    Global Const $iW2 = $iW / 2
    Global Const $iH2 = $iH / 2

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

    Global Const $hgui = GUICreate("GDI+ Rotated Letters by UEZ 2011 Beta", $iW, $iH)
    GUISetBkColor(0x202040, $hgui)
    WinSetTrans($hgui, "", 0xFF)
    GUISetState()

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

    Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hgui)
    Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphic)
    Global $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)
    Global $ps = 4
    Global $hPen = _GDIPlus_PenCreate(0xFFFFA000, $ps)
    Global $radius = 250
    Global $sText = " Rotated Letters by UEZ 2011 Beta #"
    Global $hBMP = CreateRotatedLetters($sText, $iW, $iH)

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

    Global $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hBMP, 0, 0, $iW, $iH)

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

    GUISetOnEvent(-3, "_Exit")
    Global $i = 0
    While Sleep(10)
    $i -= 0.01
    _GDIPlus_GraphicsClear($hBackbuffer, 0x80202020)
    _GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hBMP, 0, 0, $iW, $iH)
    _GDIPlus_GraphicsDrawEllipse($hBackbuffer, $ps - 2, $ps - 2, $iW - $ps - 2, $iH - $ps - 2, $hPen)
    _GDIPlus_GraphicsDrawEllipse($hBackbuffer, 95, 95, $iW - 2 * 95, $iH - 2 * 95, $hPen)
    _GDIPlus_MatrixTranslate($hMatrix, $iW2, $iH2)
    _GDIPlus_MatrixRotate($hMatrix, Sin($i), False)
    _GDIPlus_MatrixTranslate($hMatrix, -$iW2, -$iH2)
    _GDIPlus_GraphicsSetTransform($hBackbuffer, $hMatrix)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iW, $iH)
    WEnd

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

    Func CreateRotatedLetters($sText, $iW, $iH, $fontsize = 60, $radius = 250, $letter_w = 100, $letter_h = 100, $font = "Impact", $rv = 20, $gv = 100, $bv = 240, $start_angle = 0)
    Local Const $iW2 = $iW / 2
    Local Const $iH2 = $iH / 2
    Local Const $sLen = StringLen($sText)
    Local $j = $sLen / 2
    Local Const $delta_a = Floor(360 / $sLen)
    Local Const $letter_w2 = $letter_w / 2
    Local Const $letter_h2 = $letter_h / 2
    Local Const $center_x = $iW2 - $letter_w2
    Local Const $center_y = $iH2 - $letter_h2
    Local Const $deg = ACos(-1) / 180

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

    Local $aTable[$sLen][12]
    Local $i, $r, $g, $b, $a, $lW, $lH, $x, $y
    Local $hImage = _GDIPlus_BitmapCreateFromScan0($iW, $iH)
    Local $hContext = _GDIPlus_ImageGetGraphicsContext($hImage)
    For $i = 0 To $sLen - 1 ;generate table
    $aTable[$i][0] = StringMid($sText, $i + 1, 1) ;get next letter
    $aTable[$i][1] = _GDIPlus_BitmapCreateFromScan0($letter_w, $letter_h) ;create bitmap
    $aTable[$i][2] = _GDIPlus_ImageGetGraphicsContext($aTable[$i][1]) ;create context of bitmap to draw to bitmap
    $r = 0xFF - Sin($j / 10) * $rv
    $g = 0xFF - Sin($j / 10) * $gv
    $b = 0xFF - Sin($j / 10) * $bv
    $j -= 0.5
    $aTable[$i][3] = _GDIPlus_BrushCreateSolid("0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2))
    $aTable[$i][4] = _GDIPlus_StringFormatCreate() ;$hFormat
    $aTable[$i][5] = _GDIPlus_FontFamilyCreate($font) ;$hFamily
    $aTable[$i][6] = _GDIPlus_FontCreate($aTable[$i][5], $fontsize) ;$hFont
    $aTable[$i][7] = _GDIPlus_RectFCreate(0, 0, 0, 0) ;$tLayout
    $aTable[$i][8] = _GDIPlus_GraphicsMeasureString($hGraphic, $aTable[$i][0], $aTable[$i][6], $aTable[$i][7], $aTable[$i][4])
    $aTable[$i][9] = _GDIPlus_MatrixCreate() ;create a matrix for each letter
    $aTable[$i][10] = $i * $delta_a + $start_angle ;calculate angle of letter
    $aTable[$i][11] = $radius ;radius
    _GDIPlus_GraphicsSetSmoothingMode($aTable[$i][2], 2)
    DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $aTable[$i][2], "int", 3)

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

    _GDIPlus_GraphicsClear($aTable[$i][2], 0x00000000)
    ;calculated possition of letter to place it in the middle of the graphic
    $a = $aTable[$i][8]
    $lW = DllStructGetData($a[0], "width")
    $lH = DllStructGetData($a[0], "height")
    DllStructSetData($a[0], "x", $letter_w2 - $lW / 2)
    DllStructSetData($a[0], "y", $letter_h2 - $lH / 2)

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

    ;rotate letter
    _GDIPlus_MatrixTranslate($aTable[$i][9], $letter_w2, $letter_h2)
    _GDIPlus_MatrixRotate($aTable[$i][9], -27 + $aTable[$i][10], False)
    _GDIPlus_MatrixTranslate($aTable[$i][9], -$letter_w2, -$letter_h2)
    _GDIPlus_GraphicsSetTransform($aTable[$i][2], $aTable[$i][9])

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

    ;print letter to bitmap
    _GDIPlus_GraphicsDrawStringEx($aTable[$i][2], $aTable[$i][0], $aTable[$i][6], $a[0], $aTable[$i][4], $aTable[$i][3])

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

    ;copy letter to main screen in a circle
    $x = $center_x + Cos(-90 + $aTable[$i][10] * $deg) * $aTable[$i][11]
    $y = $center_y + Sin(-90 + $aTable[$i][10] * $deg) * $aTable[$i][11]
    _GDIPlus_GraphicsDrawImage($hContext, $aTable[$i][1], $x, $y)
    Next

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

    For $i = 0 To $sLen - 1
    _GDIPlus_BitmapDispose($aTable[$i][1])
    _GDIPlus_GraphicsDispose($aTable[$i][2])
    _GDIPlus_BrushDispose($aTable[$i][3])
    _GDIPlus_StringFormatDispose($aTable[$i][4])
    _GDIPlus_FontFamilyDispose($aTable[$i][5])
    _GDIPlus_FontDispose($aTable[$i][6])
    _GDIPlus_MatrixDispose($aTable[$i][9])
    Next
    _GDIPlus_GraphicsDispose($hContext)
    Return $hImage
    EndFunc ;==>CreateRotatedLetters

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

    Func _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight, $iStride = 0, $iPixelFormat = 0x0026200A, $pScan0 = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", $iStride, "int", $iPixelFormat, "ptr", $pScan0, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return $aResult[6]
    EndFunc ;==>_GDIPlus_BitmapCreateFromScan0

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

    Func _Exit()
    _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_BitmapDispose($hBMP)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    GUIDelete($hgui)
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    Ballet of Letters:

    Spoiler anzeigen
    [autoit]


    ;coded by UEZ 2011 build 2011-04-08
    #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_Obfuscated.au3"
    #AutoIt3Wrapper_UseUpx=y
    #AutoIt3Wrapper_UPX_Parameters=--brute --crp-ms=999999 --all-methods --all-filters
    #include <Array.au3>
    #include <GDIPlus.au3>
    Opt("GUIOnEventMode", 1)

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

    _GDIPlus_Startup()

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

    Global Const $iW = 600
    Global Const $iW2 = $iW / 2
    Global Const $iH = 600
    Global Const $iH2 = $iH / 2

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

    Global $hgui = GUICreate("GDI+ Ballet of Letters by UEZ 2011 Build 2011-04-08", $iW, $iH)
    GUISetBkColor(0x000000, $hgui)

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

    Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hgui)
    Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphic)
    Global $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    Global $hPen = _GDIPlus_PenCreate(0)

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

    ;~ _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)

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

    Global $sText = " Ballet of Letters by UEZ 2011 #"
    Const $sLen = StringLen($sText)
    Const $delta_a = Floor(360 / $sLen)
    Const $letter_w = 100
    Const $letter_w2 = $letter_w / 2
    Const $letter_h = 100
    Const $letter_h2 = $letter_h / 2
    Const $center_x = $iW2 - $letter_w2
    Const $center_y = $iH2 - $letter_h2

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

    Const $font = "Impact"
    Const $fontsize = $sLen * 1.75
    Const $radius = 220
    Const $deg = ACos(-1) / 180

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

    Global $aTable[$sLen][12]
    Global $j = $sLen / 2, $r, $g, $b, $a, $lW, $lH, $x, $y

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

    For $i = 0 To $sLen - 1 ;generate table
    $aTable[$i][0] = StringMid($sText, $i + 1, 1) ;get next letter
    $aTable[$i][1] = _GDIPlus_BitmapCreateFromGraphics($letter_w, $letter_h, $hGraphic) ;create bitmap
    $aTable[$i][2] = _GDIPlus_ImageGetGraphicsContext($aTable[$i][1]) ;create context of bitmap to draw to bitmap
    $r = 0xFF - Sin($j / 10) * 20
    $g = 0xFF - Sin($j / 10) * 100
    $b = 0xFF - Sin($j / 10) * 220
    $j -= 0.5
    $aTable[$i][3] = _GDIPlus_BrushCreateSolid("0xE0" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2))
    $aTable[$i][4] = _GDIPlus_StringFormatCreate() ;$hFormat
    $aTable[$i][5] = _GDIPlus_FontFamilyCreate($font) ;$hFamily
    $aTable[$i][6] = _GDIPlus_FontCreate($aTable[$i][5], $fontsize) ;$hFont
    $aTable[$i][7] = _GDIPlus_RectFCreate(0, 0, 0, 0) ;$tLayout
    $aTable[$i][8] = _GDIPlus_GraphicsMeasureString($hGraphic, $aTable[$i][0], $aTable[$i][6], $aTable[$i][7], $aTable[$i][4])
    $aTable[$i][9] = _GDIPlus_MatrixCreate() ;create a matrix for each letter
    $aTable[$i][10] = $i * $delta_a ;calculate angle of letter
    $aTable[$i][11] = $radius ;radius
    _GDIPlus_GraphicsSetSmoothingMode($aTable[$i][2], 2)
    DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $aTable[$i][2], "int", 4)
    ;~ DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $hBackbuffer, "int", 4)

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

    _GDIPlus_GraphicsClear($aTable[$i][2], 0x00000000)
    ;calculated possition of letter to place it in the middle of the graphic
    $a = $aTable[$i][8]
    $lW = DllStructGetData($a[0], "width")
    $lH = DllStructGetData($a[0], "height")
    DllStructSetData($a[0], "x", $letter_w2 - $lW / 2)
    DllStructSetData($a[0], "y", $letter_h2 - $lH / 2)

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

    ;rotate letter
    _GDIPlus_MatrixTranslate($aTable[$i][9], $letter_w2, $letter_h2)
    _GDIPlus_MatrixRotate($aTable[$i][9], -27 + $aTable[$i][10], False)
    _GDIPlus_MatrixTranslate($aTable[$i][9], -$letter_w2, -$letter_h2)
    _GDIPlus_GraphicsSetTransform($aTable[$i][2], $aTable[$i][9])

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

    ;print letter to graphic
    _GDIPlus_GraphicsDrawStringEx($aTable[$i][2], $aTable[$i][0], $aTable[$i][6], $a[0], $aTable[$i][4], $aTable[$i][3])

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

    ;copy letter to main screen in a circle
    $x = $center_x + Cos(-90 + $aTable[$i][10] * $deg) * $aTable[$i][11]
    $y = $center_y + Sin(-90 + $aTable[$i][10] * $deg) * $aTable[$i][11]
    _GDIPlus_GraphicsDrawImage($hBackbuffer, $aTable[$i][1], $x, $y)
    Next

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

    Global Const $warpZ = 16
    Global Const $units = 200
    Global $cycle = 0 ;for color
    Global Const $Z = 0.1
    Global $stars[$units][5] ;x,y,z,px,py
    Global $cx = $iW2, $cy = $iH2

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

    For $i = 0 To $units - 1
    Reset_Star($i)
    Next

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

    GUISetState()

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

    GUISetOnEvent(-3, "_Exit")

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

    While Sleep(10)
    _GDIPlus_GraphicsClear($hBackbuffer, 0x70000000)
    Draw_Stars()
    Rotation()
    _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)
    WEnd

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

    Func Rotation()
    Local Static $aa = 0
    Local Static $bb = 0
    Local Static $c = 1

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

    $aa += 0.01
    $bb += 1.5 * $c
    If $bb < -50 Or $bb > 50 Then $c *= -1

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

    For $i = 0 To $sLen - 1
    _GDIPlus_GraphicsClear($aTable[$i][2], 0x00000000)

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

    $aTable[$i][10] -= 1.5 * Cos($aa)
    $aTable[$i][11] += -$bb / 8 + Cos($bb ^2* $aa)

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

    $a = $aTable[$i][8]
    _GDIPlus_MatrixTranslate($aTable[$i][9], $letter_w2, $letter_h2)

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

    _GDIPlus_MatrixRotate($aTable[$i][9], -1 + Sin($aa) * 15, False)

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

    _GDIPlus_MatrixTranslate($aTable[$i][9], -$letter_w2, -$letter_h2)
    _GDIPlus_GraphicsSetTransform($aTable[$i][2], $aTable[$i][9])
    _GDIPlus_GraphicsDrawStringEx($aTable[$i][2], $aTable[$i][0], $aTable[$i][6], $a[0], $aTable[$i][4], $aTable[$i][3])

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

    $x = $center_x + Cos(-90 * (1 + Sin(-$aa / 100)) + $aTable[$i][10] * $deg) * $aTable[$i][11]
    $y = $center_y + Sin(-90 * (1 + Cos($aa / 20)) + $aTable[$i][10] * $deg) * $aTable[$i][11]
    _GDIPlus_GraphicsDrawImage($hBackbuffer, $aTable[$i][1], $x, $y)
    Next
    EndFunc ;==>Rotation1

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

    Func Draw_Stars()
    Local $i, $r, $g, $b, $xx, $yy, $e, $color
    Local Static $ii = -99
    $ii += 0.0075
    $cx = $iW2 + (110 * Cos($ii * 3))
    $cy = $iH2 + (100 * Sin($ii * 4))

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

    For $i = 0 To $units - 1
    $xx = $stars[$i][0] / $stars[$i][2]
    $yy = $stars[$i][1] / $stars[$i][2]
    $e = 1 + 1 / $stars[$i][2] * 2
    If $stars[$i][3] <> 0 Then
    $r = 0x40 + Sin($i + $cycle) * 50
    $g = 0x40 + Sin($i + $cycle) * 50
    $b = 0x40 + Sin($i + $cycle) * 50
    $color = "0xF0"& Hex($r, 2) & Hex($g, 2) & Hex($b, 2)
    _GDIPlus_PenSetWidth($hPen, $e)
    _GDIPlus_PenSetColor($hPen, $color)
    _GDIPlus_GraphicsDrawRect($hBackbuffer, $xx + $cx, $yy + $cy, $e, $e, $hPen)
    EndIf
    $stars[$i][2] -= $Z
    $stars[$i][3] = $xx
    $stars[$i][4] = $yy
    If $stars[$i][2] < $Z Or $stars[$i][3] > $iW Or $stars[$i][4] > $iH Then Reset_Star($i)
    Next
    $cycle += 0.1
    EndFunc

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

    Func Reset_Star($a)
    $stars[$a][0] = (Random(0, 1) * $iW - ($iW / 2)) * $warpZ
    $stars[$a][1] = (Random(0, 1) * $iH - ($iH / 2)) * $warpZ
    $stars[$a][2] = $warpZ
    $stars[$a][3] = 0
    $stars[$a][4] = 0
    EndFunc

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

    Func _Exit()
    _GDIPlus_PenDispose($hPen)
    For $i = 0 To $sLen - 1
    _GDIPlus_BitmapDispose($aTable[$i][1])
    _GDIPlus_GraphicsDispose($aTable[$i][2])
    _GDIPlus_BrushDispose($aTable[$i][3])
    _GDIPlus_StringFormatDispose($aTable[$i][4])
    _GDIPlus_FontFamilyDispose($aTable[$i][5])
    _GDIPlus_FontDispose($aTable[$i][6])
    _GDIPlus_MatrixDispose($aTable[$i][9])
    Next
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    GUIDelete($hgui)
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    Vielleicht gefällt es ja euch!

    Gruß,
    UEZ

    Edit: GDIp.au3 gibts hier: http://www.autoitscript.com/forum/topic/106021-gdip-au3

    Dateien

    Ballet of Letters.au3 7,01 kB – 541 Downloads Rotated Letters Simple.au3 6,15 kB – 495 Downloads Rotated Letters by Eukalyptus.au3 5,45 kB – 501 Downloads
  • MakeSound - eine Alternative zu Beep Melodien, mit Dateiausgabe

    • UEZ
    • 8. April 2011 um 19:54

    Schöne Umsetzung! Du bist ja ein klein Andy! ;)

    Kannst ja mal hier reinschauen: http://www.autoitscript.com/forum/index.php?showtopic=115869&view=findpost&p=810170

    Vielleicht kannst du was davon gebrauchen!

    Gruß,
    UEZ

  • Consolen Ausgabe in der in GUI

    • UEZ
    • 7. April 2011 um 22:54

    Ich würde ein Edit Control nehmen und nicht ein Label Control. Dann hast du noch einen Fehler im Lesen des CMD Outputs gehabt:

    Spoiler anzeigen
    [autoit]


    #include <Constants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    Global $pwd
    #region ### START Koda GUI section ### Form=c:\users\michach\desktop\sd-tools.kxf
    $Form1_1 = GUICreate("Form1", 568, 571)
    $Tab1 = GUICtrlCreateTab(8, 8, 553, 553)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    $TabSheet2 = GUICtrlCreateTabItem("User Profile")
    $Group1 = GUICtrlCreateGroup("Alle lokalen Profile löschen", 16, 48, 537, 97)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $Label1 = GUICtrlCreateLabel("Hostname:", 49, 88, 69, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Input1 = GUICtrlCreateInput("", 120, 86, 89, 24)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Button1 = GUICtrlCreateButton("Löschen", 223, 85, 73, 25, 0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group2 = GUICtrlCreateGroup("Profil zurücksetzen", 16, 177, 537, 113)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $Label2 = GUICtrlCreateLabel("Username:", 22, 218, 70, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Input2 = GUICtrlCreateInput("", 93, 216, 89, 24)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Button2 = GUICtrlCreateButton("Profil zurücksetzen", 206, 257, 145, 25, 0)
    $Label3 = GUICtrlCreateLabel("Homeserver:", 194, 217, 82, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Input3 = GUICtrlCreateInput("", 276, 215, 89, 24)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Label4 = GUICtrlCreateLabel("Hostname:", 378, 217, 69, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Input4 = GUICtrlCreateInput("", 447, 215, 89, 24)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    ;~ $LabelAusgabe = GUICtrlCreateLabel("", 17, 304, 540, 22)
    $LabelAusgabe = GUICtrlCreateEdit("", 17, 304, 540, 225, $ES_AUTOVSCROLL + $WS_VSCROLL)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    $Label14 = GUICtrlCreateLabel("Version 1.0", 496, 536, 57, 17)
    $TabSheet3 = GUICtrlCreateTabItem("Tools")
    GUICtrlSetState(-1, $GUI_SHOW)
    $Group3 = GUICtrlCreateGroup("Diverse Tools", 16, 48, 537, 465)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $Button3 = GUICtrlCreateButton("Display", 24, 152, 105, 25, 0)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Label5 = GUICtrlCreateLabel("( Hostname ) Öffnet die Bildschirm-Einstellungen auf dem Rechner des Benutzers", 144, 155, 384, 17)
    $Button4 = GUICtrlCreateButton("Einstellungen", 24, 202, 105, 25, 0)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Label6 = GUICtrlCreateLabel("( Hostname ) Öffnet die Einstellungen auf dem Rechner des Benutzers", 144, 205, 334, 17)
    $Button5 = GUICtrlCreateButton("Systemeig.", 24, 251, 105, 25, 0)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Label7 = GUICtrlCreateLabel("( Hostname ) Öffnet die Systemeigenschaften auf dem Rechner des Benutzers", 144, 254, 372, 17)
    $Button6 = GUICtrlCreateButton("Compverw.", 24, 301, 105, 25, 0)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Label8 = GUICtrlCreateLabel("( Hostname ) Öffnet die Computerverwaltung auf dem Rechner des Benutzers.", 144, 304, 371, 17)
    $Button7 = GUICtrlCreateButton("Quota", 24, 350, 105, 25, 0)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Label9 = GUICtrlCreateLabel("( Hostname ) Startet eine Quota Abfrage auf dem Host für den Benutzer.", 144, 353, 343, 17)
    $Label11 = GUICtrlCreateLabel("Hostname:", 58, 96, 69, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Input5 = GUICtrlCreateInput("", 128, 94, 89, 24)
    $Label12 = GUICtrlCreateLabel("Benutzername:", 302, 96, 93, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Input6 = GUICtrlCreateInput("", 396, 94, 89, 24)
    $Button9 = GUICtrlCreateButton("Shutdown", 25, 410, 105, 25, 0)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFF0000)
    $Label13 = GUICtrlCreateLabel("( Hostname ) Startet den Rechner innerhalt 5 Sek. neu. ( Erzwungen )", 145, 413, 332, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Label10 = GUICtrlCreateLabel("Version 1.0", 497, 537, 57, 17)
    $TabSheet4 = GUICtrlCreateTabItem("Hilfe")
    GUICtrlCreateTabItem("")
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

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

    ;If FileExists("c:\Kopie") Then

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

    While 1

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

    ;Variablen
    $tab1hostname1 = GUICtrlRead($Input1)
    $tab1username = GUICtrlRead($Input2)
    $tab1homeserver = GUICtrlRead($Input3)
    $tab1hostname2 = GUICtrlRead($Input4)

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

    $tab2hostname = GUICtrlRead($Input5)
    $tab2username = GUICtrlRead($Input6)

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

    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    ;Case $Tab1

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

    ;###################################################################
    ;Alle lokalen Profile löschen
    ;###################################################################
    Case $Button1
    ConsoleWrite("huhu")
    ;$tab1hostname1 = GUICtrlRead ($Input1)
    $cmdProfilLoeschen = Run(@ComSpec & " /c dir c:\", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    ;~ $cmdProfilLoeschen = Run(@ComSpec & " /c delprof /c:\\" & $tab1hostname1 & " /i /q", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    While 1
    $ausgabe = StdoutRead($cmdProfilLoeschen)
    If @error Then ExitLoop
    GUICtrlSetData($LabelAusgabe, $ausgabe)
    WEnd

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

    ;###################################################################
    ;Profil zurücksetzen
    ;###################################################################
    Case $Button2
    ;Lokales Profil löschen

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

    ;Server Profil kopieren
    If ($tab1hostname2 == "" Or $tab1username == "" Or $tab1homeserver == "") Then
    GUICtrlSetData($LabelAusgabe, "Bitte alle Felder ausfüllen!")
    Else
    $kopieren = DirCopy("\\" & $tab1hostname2 & "\profile\" & $tab1username, "\\" & $tab1hostname2 & "\profile\" & $tab1username & ".sic")
    GUICtrlSetData($LabelAusgabe, "Alle Felder ausgefüllt.")
    EndIf

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

    ;###################################################################
    ;Display auf dem Host anzeigen
    ;###################################################################
    Case $Button3
    If ($tab2hostname == "") Then
    GUICtrlSetData($LabelAusgabe, "Bitte den Hostnamen eingeben!")
    Else
    $cmdDisplay = Run(@ComSpec & " /c psexec \\" & $tab2hostname & " -u ewenet\%username% -i -p " & $pwd & " c:\winnt\system32\control.exe desk.cpl")
    ;GUICtrlSetData ($LabelAusgabe,$cmdDisplay)
    EndIf

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

    ;###################################################################
    ;Führt settings.bat auf dem Host aus
    ;###################################################################
    Case $Button4
    If ($tab2hostname == "") Then
    GUICtrlSetData($LabelAusgabe, "Bitte den Hostnamen eingeben!")
    Else
    $cmdEinstellungen = Run(@ComSpec & " /c Psexec \\" & $tab2hostname & " -s c:\winnt\settings.bat")
    EndIf

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

    ;###################################################################
    ;Systemeigenschaften auf dem Host anzeigen
    ;###################################################################
    Case $Button5
    $cmdSystem = Run(@ComSpec & " /c psexec \\" & $tab2hostname & " -u ewenet\%username% -i c:\winnt\system32\rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,0")

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

    ;###################################################################
    ;Computerverwaltung auf dem Host anzeigen
    ;###################################################################
    Case $Button6
    $cmdComputer = Run(@ComSpec & " /c psexec \\" & $tab2hostname & " -u ewenet\%username% -i -w C:\WINNT\system32 C:\WINNT\system32\mmc.exe C:\WINNT\system32\compmgmt.msc")

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

    ;###################################################################
    ;Quota des Benutzers abfragen
    ;###################################################################
    Case $Button7
    ;$cmdQuota = Run(@COMSPEC & " /c Psexec \\"&$tab2hostname&" -s c:\winnt\settings.bat >NUL)

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

    EndSwitch
    WEnd

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

    ;InetGet - Lädt eine Datei aus dem Internet

    [/autoit]

    Wenn du auf Löschen klickst, wird dir c:\ hier ausgeführt zwecks Demo! ;)

    Gruß,
    UEZ

  • Binärdatei zusammensetzen

    • UEZ
    • 6. April 2011 um 20:40

    Sorry, hatte den Code nur überflogen. :whistling:

    Das das Problem gelöst ist, wollte ich nur sagen, dass das Zusammensetzen genau den doppelten Binärstring erzeugt....


    Gruß,
    UEZ

  • Binärdatei zusammensetzen

    • UEZ
    • 6. April 2011 um 20:14

    War da nicht ein Limit in Ini Dateien (32kb)?

    Gruß,
    UEZ

  • Dodge the bullet (GDI+)

    • UEZ
    • 6. April 2011 um 20:11

    Nette Umsetzung!

    Warum kann ich nicht das Spiel neustarten, wenn ich verloren habe? Ein Spielstart Knopf wäre auch nicht schlecht.

    Füge

    [autoit]

    _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)

    [/autoit]

    hinzu, damit die Punkte besser aussehen.

    Eine Highscore wäre auch nicht schlecht!


    Gruß,
    UEZ

  • Zeitansage (Standard Std:Min und Umgangssprachlich)

    • UEZ
    • 6. April 2011 um 10:14

    Vielen Dank Raupi!

    Läuft wie gewünscht! :thumbup:

    Gruß,
    UEZ

  • Zeitansage (Standard Std:Min und Umgangssprachlich)

    • UEZ
    • 5. April 2011 um 22:41

    Kann man die Zeitansage parallel zur Laufzeit des Skript durchführen? Z.B. soll mein Skript weiterlaufen und nicht pausieren, wenn die Zeit angesagt wird!

    Gruß,
    UEZ

  • Bass.dll UDF Version_10 Download

    • UEZ
    • 5. April 2011 um 20:34

    Ein riesen Lob von mir für deine Bemühungen dieses super Packet zu erstellen!

    Klasse! :thumbup:

    Vielleicht könntest du die GDI+ Beispiele in ein separaten Ordner tun, damit man sie schneller finden kann! :whistling:

    Gruß,
    UEZ

  • Array sortieren

    • UEZ
    • 5. April 2011 um 14:20

    Meinst du so was?:

    Spoiler anzeigen
    [autoit]


    #include <Array.au3>
    Global $avArray[7][3] = [ _
    ["Gruppe 1", 20, 8], _
    ["Gruppe 2", 32, 7], _
    ["Gruppe 2", 16, 9], _
    ["Gruppe 2", 34, 7], _
    ["Gruppe 2", 122, 9], _
    ["Gruppe 1", 35, 0], _
    ["Gruppe 3", 19, 6]]

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

    Dim $aI[3]
    $aI[0] = 0
    $aI[1] = 1
    $aI[2] = 2

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

    _ArraySort_MultiColumn($avArray, $aI)
    _ArrayDisplay($avArray, 'After:')

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

    ; #FUNCTION# =============================================================================
    ; Name.............: _ArraySort_MultiColumn
    ; Description ...: sorts an array at given colums (multi colum sort)
    ; Syntax...........: _ArraySort_MultiColumn(ByRef $aSort, ByRef $aIndices)
    ; Parameters ...: $aSort - array to sort
    ; $aIndices - array with colum indices which should be sorted in specified order - zero based
    ; $oDir/$iDir - sort direction - if set to 1, sort descendingly else ascendingly
    ; Author .........: UEZ
    ; Version ........: v0.70 build 2013-11-20 Beta
    ; =========================================================================================
    Func _ArraySort_MultiColumn(ByRef $aSort, ByRef $aIndices, $oDir = 0, $iDir = 0)
    If Not IsArray($aIndices) Or Not IsArray($aSort) Then Return SetError(1, 0, 0) ;checks if $aIndices is an array
    If UBound($aIndices) > UBound($aSort, 2) Then Return SetError(2, 0, 0) ;check if $aIndices array is greater the $aSort array
    Local $1st, $2nd, $x, $j, $k, $l = 0
    For $x = 0 To UBound($aIndices) - 1 ;check if array content makes sense
    If Not IsInt($aIndices[$x]) Then Return SetError(3, 0, 0) ;array content is not numeric
    Next
    If UBound($aIndices) = 1 Then Return _ArraySort($aSort, $oDir, 0, 0, $aIndices[0]) ;check if only one index is given
    _ArraySort($aSort, $oDir, 0, 0, $aIndices[0])
    Do
    $1st = $aIndices[$l]
    $2nd = $aIndices[$l + 1]
    $j = 0
    $k = 1
    While $k < UBound($aSort)
    If $aSort[$j][$1st] <> $aSort[$k][$1st] Then
    If $k - $j > 1 Then
    _ArraySort($aSort, $iDir , $j, $k - 1, $2nd)
    $j = $k
    Else
    $j = $k
    EndIf
    EndIf
    $k += 1
    WEnd
    If $k - $j > 1 Then _ArraySort($aSort, $iDir, $j, $k, $2nd)
    $l += 1
    Until $l = UBound($aIndices) - 1
    Return 1
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Musik Datei analysieren - Vorzugsweise Morsecode - dringend

    • UEZ
    • 30. März 2011 um 19:11

    Schaue mal in die Console! ;)

    Gruß,
    UEZ

  • Musik Datei analysieren - Vorzugsweise Morsecode - dringend

    • UEZ
    • 30. März 2011 um 16:11

    Sehr interessante Spielerei und klasse Lösung eukalyptus :thumbup:

    Gruß,
    UEZ

  • User einlesen

    • UEZ
    • 29. März 2011 um 22:22

    Hier die WMI Version, um die Benutzer auszulesen:

    Spoiler anzeigen
    [autoit]


    #include <GuiComboBox.au3>
    #include <GUIConstantsEx.au3>
    $Form1 = GUICreate("Sperrung / Freigabe", 417, 315, 287, 147)
    $Label1 = GUICtrlCreateLabel("Benutzername", 10, 72, 109, 24)
    $hCombo = GUICtrlCreateCombo("", 120, 72, 289, 24)
    GUICtrlSetData(-1, Get_Users())
    _GUICtrlComboBox_SetCurSel ($hCombo, 0)
    $Label2 = GUICtrlCreateLabel("Montag", 29, 122, 49, 17)
    $Label3 = GUICtrlCreateLabel("Dienstag", 23, 150, 55, 20)
    $Label4 = GUICtrlCreateLabel("Mittwoch", 27, 176, 51, 19)
    $Label5 = GUICtrlCreateLabel("Donnerstag", 8, 204, 70, 18)
    $Label6 = GUICtrlCreateLabel("Freitag", 36, 231, 42, 20)
    $Label7 = GUICtrlCreateLabel("Samstag", 25, 258, 53, 19)
    $Label8 = GUICtrlCreateLabel("Sonntag", 29, 285, 49, 19)
    $Label9 = GUICtrlCreateLabel("von", 89, 104, 24, 16)
    $Label10 = GUICtrlCreateLabel("bis", 122, 105, 20, 14)
    $Input1 = GUICtrlCreateInput("0", 88, 120, 25, 24)
    $Input2 = GUICtrlCreateInput("23", 120, 120, 25, 24)
    $Input3 = GUICtrlCreateInput("0", 88, 147, 25, 24)
    $Input4 = GUICtrlCreateInput("23", 120, 147, 25, 24)
    $Input5 = GUICtrlCreateInput("0", 88, 174, 25, 24)
    $Input6 = GUICtrlCreateInput("23", 120, 174, 25, 24)
    $Input7 = GUICtrlCreateInput("0", 88, 201, 25, 24)
    $Input8 = GUICtrlCreateInput("23", 120, 201, 25, 24)
    $Input9 = GUICtrlCreateInput("0", 88, 228, 25, 24)
    $Input10 = GUICtrlCreateInput("23", 120, 228, 25, 24)
    $Input11 = GUICtrlCreateInput("0", 88, 255, 25, 24)
    $Input12 = GUICtrlCreateInput("23", 120, 255, 25, 24)
    $Input13 = GUICtrlCreateInput("0", 88, 282, 25, 24)
    $Input14 = GUICtrlCreateInput("23", 120, 282, 25, 24)
    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    EndSwitch
    WEnd

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

    Func Get_Users($system = ".")
    Local $Users
    Local $objWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & $system & "\root\cimv2")
    Local $colItems = $objWMIService.ExecQuery("SELECT Caption FROM Win32_UserAccount WHERE Disabled = False", "WQL", 0x30)
    For $objItem In $colItems
    $Users &= $objItem.Caption & "|"
    Next
    Return $Users
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • [GDI+] Verwischen / Unscharf machen

    • UEZ
    • 28. März 2011 um 20:55

    Hier eine alternativ Funktion von Eukalyptus:

    [autoit]


    Func _Blur($hBitmap, $iW, $iH, $fScale = 0.175, $qual = 6); by eukalyptus
    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND(_WinAPI_GetDesktopWindow())
    Local $hBmpSmall = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
    Local $hGfxSmall = _GDIPlus_ImageGetGraphicsContext($hBmpSmall)

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

    Local $hBmpBig = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
    Local $hGfxBig = _GDIPlus_ImageGetGraphicsContext($hBmpBig)

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

    _GDIPlus_GraphicsScaleTransform($hGfxSmall, $fScale, $fScale)
    _GDIPlus_GraphicsSetInterpolationMode($hGfxSmall, $qual)

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

    _GDIPlus_GraphicsScaleTransform($hGfxBig, 1 / $fScale, 1 / $fScale)
    _GDIPlus_GraphicsSetInterpolationMode($hGfxBig, $qual)

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

    _GDIPlus_GraphicsDrawImageRect($hGfxSmall, $hBitmap, 0, -5, $iW, $iH + 12)
    _GDIPlus_GraphicsDrawImageRect($hGfxBig, $hBmpSmall, 0, -3, $iW, $iH + 9)

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

    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_BitmapDispose($hBmpSmall)
    _GDIPlus_GraphicsDispose($hGfxSmall)
    _GDIPlus_GraphicsDispose($hGfxBig)
    Return $hBmpBig
    EndFunc ;==>_Blur

    [/autoit]

    Gruß,
    UEZ

  • Höchsten Farbanteil ausgeben.

    • UEZ
    • 27. März 2011 um 22:24
    Zitat von pretrojaner


    nun wenn ich z.b. nur ein SW Bild habe mit 60% Schwarzanteil so kann ich mir sicher leicht eine Funktion basteln die mir die Farbe Schwarz als höchsten Farbanteil ausgibt.

    Wie mache ich das nun bei einem Farbbild ? Muss ich da wirklich pixel für pixel die farbanteile durchgehen? könnte mir vorstellen das dieses zu lange dauert bei großen bildern. vileicht gehts ja auch anderst ?

    Gruß
    Pre

    Wie willst du den Anteil herausbekommen, wenn du nicht jedes Pixel auf den Farbwert prüfst?

    Hier muss man mal in GDIp.au3 schauen oder eine schnelle ASM Routine basteln.

    Gruß,
    UEZ

  • Must Have Programme auf dem Rechner

    • UEZ
    • 27. März 2011 um 21:53

    Eigentlich auch mein Motto: IBM (Immer Besser Manuel) ;)

    Gruß,
    UEZ

  • Must Have Programme auf dem Rechner

    • UEZ
    • 27. März 2011 um 21:14

    Hier eine nette Seite, um seine Must Have Apps (Freeware) zu installieren: http://ninite.com/

    Gruß,
    UEZ

  • Screenshoot rahmen abschneiden

    • UEZ
    • 27. März 2011 um 20:51

    Probiere es mal mit dieser Funktion:

    [autoit]


    Func __ScreenCapture_CaptureWnd($sFileName, $hWnd, $iLeft = 0, $iTop = 0, $iRight = -1, $iBottom = -1, $maximized = False)
    Local $dex = 4, $dey = 1
    Local $tRect = _WinAPI_GetWindowRect($hWnd)
    If BitAND($maximized, 32) Then
    $dex = 8
    $dey = 8
    EndIf
    $iLeft += DllStructGetData($tRect, "Left")
    $iTop += DllStructGetData($tRect, "Top")
    If $iRight = -1 Then $iRight = DllStructGetData($tRect, "Right") - DllStructGetData($tRect, "Left")
    If $iBottom = -1 Then $iBottom = DllStructGetData($tRect, "Bottom") - DllStructGetData($tRect, "Top")
    $iRight += DllStructGetData($tRect, "Left")
    $iBottom += DllStructGetData($tRect, "Top")
    If $iLeft > DllStructGetData($tRect, "Right") Then $iLeft = DllStructGetData($tRect, "Left")
    If $iTop > DllStructGetData($tRect, "Bottom") Then $iTop = DllStructGetData($tRect, "Top")
    If $iRight > DllStructGetData($tRect, "Right") Then $iRight = DllStructGetData($tRect, "Right")
    If $iBottom > DllStructGetData($tRect, "Bottom") Then $iBottom = DllStructGetData($tRect, "Bottom")
    Return _ScreenCapture_Capture($sFileName, $iLeft + $dex, $iTop + $dey, $iRight - $dex, $iBottom- $dey, False)
    EndFunc ;==>_ScreenCapture_CaptureWnd

    [/autoit]

    Ist aus AutoIt Windows Screenshooter .

    Gruß,
    UEZ

  • Wechselt/Updatet ihr euren Browser?

    • UEZ
    • 23. März 2011 um 21:42

    Seit dem ich Probleme beim Posten im engl. Forum habe, benutze ich Iron für autoitscript.com und autoit.de, auf der Arbeit für Intranetseiten IE9, sonst FF 3/4.

    Iron gefällt mir eigentlich ganz gut.

    Opera benutze ich so gut wie nie.

    Alle Browser, bis auf IE, sind portable Versionen.

    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™