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

  • ASM SSE shuffle explorer (pshufd shufps ...)

    • eukalyptus
    • 26. Juli 2013 um 19:00

    Hi

    Wer in Assembler mit den SSE Befehlen arbeitet, kommt um die shuffle-Befehle nicht herum.
    Damit kann man die Werte im SSE-Register gewissermaßen vertauschen.

    Um das gewünschte Resultat zu erhalten, muss man den korrekten Hex-Code angeben - und diesen herauszufinden kostete mich immer etwas Zeit!
    Ganz zu schweigen von der Zeit, die ich vertrödelt hab, nachdem ich wegen eines falschen Hexwertes den restlichen ASM-Code nach Fehlern absuchte ;(

    Deswegen hab ich mir dieses Helferprogramm geschrieben, welches die Verwendung von pshufd, shufps, shufpd, pshuflw und pshufhw erleichtern und auch grafisch darstellen soll:

    Spoiler anzeigen
    [autoit]

    #include <EditConstants.au3>
    #include <GuiComboBoxEx.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

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

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

    Global $iWidth = 1200
    Global $iHeight = 500

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

    Global $iYPosXMM = 150
    Global $iYPosDst = 420
    Global $iYPosDstCB = $iYPosDst + 30
    Global $iGfxH = $iYPosDst - $iYPosXMM - 50

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

    Global $hGui = GUICreate("SSE_Shuffle Explorer by Eukalyptus http://www.autoit.de", $iWidth, $iHeight)
    GUISetOnEvent(-3, "_Exit")

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

    GUICtrlCreateLabel("ShuffleMode:", 20, 22, 80, 20)
    Global $cRB_PSHUFD = GUICtrlCreateRadio("PSHUFD", 110, 20, 100, 20)
    GUICtrlSetState(-1, $GUI_CHECKED)
    GUICtrlSetOnEvent(-1, "_SetMode")
    Global $cRB_SHUFPS = GUICtrlCreateRadio("SHUFPS", 210, 20, 100, 20)
    GUICtrlSetOnEvent(-1, "_SetMode")
    Global $cRB_SHUFPD = GUICtrlCreateRadio("SHUFPD", 310, 20, 100, 20)
    GUICtrlSetOnEvent(-1, "_SetMode")
    Global $cRB_PSHUFLW = GUICtrlCreateRadio("PSHUFLW", 410, 20, 100, 20)
    GUICtrlSetOnEvent(-1, "_SetMode")
    Global $cRB_PSHUFHW = GUICtrlCreateRadio("PSHUFHW", 510, 20, 100, 20)
    GUICtrlSetOnEvent(-1, "_SetMode")

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

    GUICtrlCreateLabel("Bin:", 20, 52, 80, 20)
    Global $cIP_Bin = GUICtrlCreateInput("00000000", 110, 50, 100, 20)
    GUICtrlCreateLabel("Hex:", 20, 82, 80, 20)
    Global $cIP_Hex = GUICtrlCreateInput("0x00", 110, 80, 100, 20)

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

    Global $cGfx = GUICtrlCreateGraphic(0, $iYPosXMM + 25, $iWidth, $iGfxH)

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

    Global $aXmm0[8][3], $aXmm1[8][3], $aDst[8][3], $aDstCB[8], $aInf[4]

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

    $aInf[0] = GUICtrlCreateLabel("Xmm0", 0, 0, 20, 20, BitOR(0x01, 0x0200))
    GUICtrlSetBkColor(-1, 0x440000)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $aInf[1] = GUICtrlCreateLabel("Xmm1", 0, 0, 20, 20, BitOR(0x01, 0x0200))
    GUICtrlSetBkColor(-1, 0x004400)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $aInf[2] = GUICtrlCreateLabel("Xmm0", $iWidth / 2 - (($iWidth - 20) / 4) + 2, $iYPosDst - 20, (($iWidth - 20) / 4) * 2 - 4, 14, BitOR(0x01, 0x0200))
    GUICtrlSetBkColor(-1, 0x000044)
    GUICtrlSetColor(-1, 0xFFFFFF)

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

    GUICtrlCreateLabel("", $iWidth / 2 - 200, 80, 400, 28)
    GUICtrlSetBkColor(-1, 0x004400)
    $aInf[3] = GUICtrlCreateLabel("", $iWidth / 2 - 200+1, 80+1, 400-2, 28-2, BitOR(0x01, 0x0200))
    GUICtrlSetFont(-1, 16)
    GUICtrlSetBkColor(-1, 0xDDEEFF)
    GUICtrlSetColor(-1, 0x000044)

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

    For $i = 0 To 7
    $aXmm0[$i][0] = GUICtrlCreateLabel("DST_" & $i, 0, 0, 20, 20, BitOR(0x01, 0x0200))
    GUICtrlSetBkColor(-1, 0x880000)
    GUICtrlSetColor(-1, 0xFFFFFF)

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

    $aXmm1[$i][0] = GUICtrlCreateLabel("SRC_" & $i, 0, 0, 20, 20, BitOR(0x01, 0x0200))
    GUICtrlSetBkColor(-1, 0x008800)
    GUICtrlSetColor(-1, 0xFFFFFF)

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

    $aDst[$i][0] = GUICtrlCreateLabel($i, 0, 0, 20, 20, BitOR(0x01, 0x0200))
    GUICtrlSetBkColor(-1, 0x000088)
    GUICtrlSetColor(-1, 0xFFFFFF)

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

    $aDstCB[$i] = GUICtrlCreateCombo("", 0, 0, 20, 20)
    GUICtrlSetOnEvent(-1, "_SetSrc")
    Next

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

    _SetMode()

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

    GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

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

    GUISetState()

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

    While Sleep(10)
    WEnd

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

    Func _SetSrc()
    Local $iOff = 0
    If GUICtrlRead($cRB_PSHUFHW) = 1 Then $iOff = 4

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

    For $i = 0 To 3
    If @GUI_CtrlId = $aDstCB[$i + $iOff] Then
    Local $aRegExp = StringRegExp(GUICtrlRead($aDstCB[$i + $iOff]), "\((\d+)\)", 3)
    If Not IsArray($aRegExp) Then ContinueLoop

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

    If GUICtrlRead($cRB_SHUFPD) = 1 Then
    Local $iHex = GUICtrlRead($cIP_Hex)
    If $aRegExp[0] = "00" Then
    If BitAND($iHex, $i + 1) Then $iHex = BitXOR($iHex, $i + 1)
    Else
    $iHex = BitOR($iHex, $i + 1)
    EndIf

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

    GUICtrlSetData($cIP_Hex, "0x" & Hex(BitAND($iHex, 3), 2))
    Else
    Local $sBin = StringFormat("%08s", GUICtrlRead($cIP_Bin))

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

    Switch $i
    Case 0
    $sBin = StringLeft($sBin, 6) & $aRegExp[0]
    Case 1
    $sBin = StringLeft($sBin, 4) & $aRegExp[0] & StringRight($sBin, 2)
    Case 2
    $sBin = StringLeft($sBin, 2) & $aRegExp[0] & StringRight($sBin, 4)
    Case 3
    $sBin = $aRegExp[0] & StringRight($sBin, 6)
    EndSwitch

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

    GUICtrlSetData($cIP_Bin, $sBin)
    EndIf

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

    ExitLoop
    EndIf
    Next

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

    EndFunc ;==>_SetSrc

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

    Func _DrawCon()
    GUICtrlDelete($cGfx)
    $cGfx = GUICtrlCreateGraphic(0, $iYPosXMM + 25, $iWidth, $iGfxH)
    GUICtrlSetGraphic($cGfx, $GUI_GR_PENSIZE, 3)
    GUICtrlSetGraphic($cGfx, $GUI_GR_COLOR, 0x000066)

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

    Local $aRegExp

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

    For $i = 0 To 7
    If BitAND(GUICtrlGetState($aDstCB[$i]), $GUI_HIDE) Then ContinueLoop
    GUICtrlSetGraphic($cGfx, $GUI_GR_MOVE, $aDst[$i][1] + $aDst[$i][2] / 2, $iGfxH)

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

    $aRegExp = StringRegExp(GUICtrlRead($aDstCB[$i]), "\)\h+(\w+)_(\d)", 3)
    If UBound($aRegExp) < 2 Then ContinueLoop

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

    Switch $aRegExp[0]
    Case "SRC"
    GUICtrlSetGraphic($cGfx, $GUI_GR_LINE, $aXmm1[$aRegExp[1]][1] + $aXmm1[$aRegExp[1]][2] / 2, 0)
    GUICtrlSetBkColor($aDst[$i][0], 0x008800)
    GUICtrlSetData($aDst[$i][0], $aRegExp[0] & "_" & $aRegExp[1])
    Case "DST"
    GUICtrlSetGraphic($cGfx, $GUI_GR_LINE, $aXmm0[$aRegExp[1]][1] + $aXmm0[$aRegExp[1]][2] / 2, 0)
    GUICtrlSetBkColor($aDst[$i][0], 0x880000)
    GUICtrlSetData($aDst[$i][0], $aRegExp[0] & "_" & $aRegExp[1])
    EndSwitch
    Next

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

    GUICtrlSetGraphic($cGfx, $GUI_GR_REFRESH)
    EndFunc ;==>_DrawCon

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

    Func _CalcShufle()
    Local $iHex = GUICtrlRead($cIP_Hex)

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

    If GUICtrlRead($cRB_SHUFPD) = 1 Then
    If BitAND($iHex, 1) Then
    _GUICtrlComboBoxEx_SetCurSel(GUICtrlGetHandle($aDstCB[0]), 1)
    Else
    _GUICtrlComboBoxEx_SetCurSel(GUICtrlGetHandle($aDstCB[0]), 0)
    EndIf
    If BitAND($iHex, 2) Then
    _GUICtrlComboBoxEx_SetCurSel(GUICtrlGetHandle($aDstCB[1]), 1)
    Else
    _GUICtrlComboBoxEx_SetCurSel(GUICtrlGetHandle($aDstCB[1]), 0)
    EndIf
    Else
    Local $sBin = StringFormat("%08s", GUICtrlRead($cIP_Bin))
    Local $aSplit = StringRegExp($sBin, "\d{2}", 3)
    If UBound($aSplit) <> 4 Then Return

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

    Local $iOff = 3
    If GUICtrlRead($cRB_PSHUFHW) = 1 Then $iOff = 7
    For $i = 0 To UBound($aSplit) - 1
    _GUICtrlComboBoxEx_SetCurSel(GUICtrlGetHandle($aDstCB[$iOff - $i]), _TranslateBase($aSplit[$i], 2, 10))
    Next
    EndIf

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

    Select
    Case GUICtrlRead($cRB_PSHUFD) = 1
    GUICtrlSetData($aInf[3], "pshufd xmm0, xmm1, " & $iHex)
    Case GUICtrlRead($cRB_SHUFPS) = 1
    GUICtrlSetData($aInf[3], "shufps xmm0, xmm1, " & $iHex)
    Case GUICtrlRead($cRB_SHUFPD) = 1
    GUICtrlSetData($aInf[3], "shufpd xmm0, xmm1, " & $iHex)
    Case GUICtrlRead($cRB_PSHUFLW) = 1
    GUICtrlSetData($aInf[3], "pshuflw xmm0, xmm1, " & $iHex)
    Case GUICtrlRead($cRB_PSHUFHW) = 1
    GUICtrlSetData($aInf[3], "pshufhw xmm0, xmm1, " & $iHex)
    EndSelect

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

    _DrawCon()
    EndFunc ;==>_CalcShufle

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

    Func _SetMode()
    Select
    Case (GUICtrlRead($cRB_PSHUFD) = 1) Or (GUICtrlRead($cRB_SHUFPS) = 1)
    Local $iSize = ($iWidth - 20) / 8
    For $i = 0 To 3
    GUICtrlSetState($aDst[$i][0], BitOR($GUI_SHOW, $GUI_ENABLE))
    GUICtrlSetState($aDstCB[$i], BitOR($GUI_SHOW, $GUI_ENABLE))
    $aDst[$i][1] = $iWidth * 0.5 + $iSize - $i * $iSize
    $aDst[$i][2] = $iSize
    GUICtrlSetPos($aDst[$i][0], $aDst[$i][1] + 2, $iYPosDst, $aDst[$i][2] - 4, 20)
    GUICtrlSetPos($aDstCB[$i], $aDst[$i][1] + 2, $iYPosDstCB, $aDst[$i][2] - 4, 20)
    Next
    For $i = 4 To 7
    GUICtrlSetState($aDst[$i][0], $GUI_HIDE)
    GUICtrlSetState($aDstCB[$i], $GUI_HIDE)
    Next

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

    Case GUICtrlRead($cRB_SHUFPD) = 1
    Local $iSize = ($iWidth - 20) / 4
    For $i = 0 To 1
    GUICtrlSetState($aDst[$i][0], BitOR($GUI_SHOW, $GUI_ENABLE))
    GUICtrlSetState($aDstCB[$i], BitOR($GUI_SHOW, $GUI_ENABLE))
    $aDst[$i][1] = $iWidth * 0.5 - $i * $iSize
    $aDst[$i][2] = $iSize
    GUICtrlSetPos($aDst[$i][0], $aDst[$i][1] + 2, $iYPosDst, $aDst[$i][2] - 4, 20)
    GUICtrlSetPos($aDstCB[$i], $aDst[$i][1] + 2, $iYPosDstCB, $aDst[$i][2] - 4, 20)
    Next
    For $i = 2 To 7
    GUICtrlSetState($aDst[$i][0], $GUI_HIDE)
    GUICtrlSetState($aDstCB[$i], $GUI_HIDE)
    Next

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

    Case (GUICtrlRead($cRB_PSHUFLW) = 1) Or (GUICtrlRead($cRB_PSHUFHW) = 1)
    Local $iSize = ($iWidth - 20) / 16
    For $i = 0 To 7
    GUICtrlSetState($aDst[$i][0], BitOR($GUI_SHOW, $GUI_ENABLE))
    GUICtrlSetState($aDstCB[$i], BitOR($GUI_SHOW, $GUI_ENABLE))
    $aDst[$i][1] = $iWidth * 0.5 + $iSize * 3 - $i * $iSize
    $aDst[$i][2] = $iSize
    GUICtrlSetPos($aDst[$i][0], $aDst[$i][1] + 2, $iYPosDst, $aDst[$i][2] - 4, 20)
    GUICtrlSetPos($aDstCB[$i], $aDst[$i][1] + 2, $iYPosDstCB, $aDst[$i][2] - 4, 20)
    Next

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

    If GUICtrlRead($cRB_PSHUFLW) = 1 Then
    For $i = 4 To 7
    GUICtrlSetState($aDst[$i][0], $GUI_DISABLE)
    GUICtrlSetState($aDstCB[$i], $GUI_DISABLE)
    Next
    Else
    For $i = 0 To 3
    GUICtrlSetState($aDst[$i][0], $GUI_DISABLE)
    GUICtrlSetState($aDstCB[$i], $GUI_DISABLE)
    Next
    EndIf
    EndSelect

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

    For $i = 0 To 7
    GUICtrlSetData($aDstCB[$i], "")
    GUICtrlSetBkColor($aDst[$i][0], 0x000088)
    GUICtrlSetData($aDst[$i][0], $i)
    Next

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

    Select
    Case GUICtrlRead($cRB_PSHUFD) = 1
    For $i = 0 To 3
    GUICtrlSetData($aDstCB[$i], "|(00) SRC_0|(01) SRC_1|(10) SRC_2|(11) SRC_3")
    Next

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

    Case GUICtrlRead($cRB_SHUFPS) = 1
    For $i = 0 To 1
    GUICtrlSetData($aDstCB[$i + 2], "|(00) SRC_0|(01) SRC_1|(10) SRC_2|(11) SRC_3")
    GUICtrlSetData($aDstCB[$i], "|(00) DST_0|(01) DST_1|(10) DST_2|(11) DST_3")
    Next

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

    Case GUICtrlRead($cRB_SHUFPD) = 1
    GUICtrlSetData($aDstCB[1], "|(00) SRC_0|(01) SRC_1")
    GUICtrlSetData($aDstCB[0], "|(00) DST_0|(01) DST_1")

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

    Case GUICtrlRead($cRB_PSHUFLW) = 1
    For $i = 0 To 3
    GUICtrlSetData($aDstCB[$i], "|(00) SRC_0|(01) SRC_1|(10) SRC_2|(11) SRC_3")
    GUICtrlSetData($aDstCB[$i + 4], "|(00) SRC_" & $i + 4, "(00) SRC_" & $i + 4)
    Next

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

    Case GUICtrlRead($cRB_PSHUFHW) = 1
    For $i = 4 To 7
    GUICtrlSetData($aDstCB[$i], "|(00) SRC_4|(01) SRC_5|(10) SRC_6|(11) SRC_7")
    GUICtrlSetData($aDstCB[$i - 4], "|(00) SRC_" & $i - 4, "(00) SRC_" & $i - 4)
    Next
    EndSelect

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

    Select
    Case GUICtrlRead($cRB_PSHUFD) = 1
    Local $iSize = ($iWidth - 20) / 8
    For $i = 0 To 3
    GUICtrlSetState($aXmm0[$i][0], $GUI_HIDE)

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

    GUICtrlSetState($aXmm1[$i][0], BitOR($GUI_SHOW, $GUI_ENABLE))
    $aXmm1[$i][1] = $iWidth * 0.5 + $iSize - $i * $iSize
    $aXmm1[$i][2] = $iSize
    GUICtrlSetPos($aXmm1[$i][0], $aXmm1[$i][1] + 2, $iYPosXMM, $aXmm1[$i][2] - 4, 20)
    Next

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

    For $i = 4 To 7
    GUICtrlSetState($aXmm0[$i][0], $GUI_HIDE)
    GUICtrlSetState($aXmm1[$i][0], $GUI_HIDE)
    Next

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

    Case GUICtrlRead($cRB_SHUFPS) = 1
    Local $iSize = ($iWidth - 20) / 8
    For $i = 0 To 3
    GUICtrlSetState($aXmm0[$i][0], BitOR($GUI_SHOW, $GUI_ENABLE))
    $aXmm0[$i][1] = $iWidth * 0.5 - ($i + 1) * $iSize
    $aXmm0[$i][2] = $iSize
    GUICtrlSetPos($aXmm0[$i][0], $aXmm0[$i][1] + 2, $iYPosXMM, $aXmm0[$i][2] - 4, 20)

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

    GUICtrlSetState($aXmm1[$i][0], BitOR($GUI_SHOW, $GUI_ENABLE))
    $aXmm1[$i][1] = $iWidth * 0.5 + $iSize * 3 - $i * $iSize
    $aXmm1[$i][2] = $iSize
    GUICtrlSetPos($aXmm1[$i][0], $aXmm1[$i][1] + 2, $iYPosXMM, $aXmm1[$i][2] - 4, 20)
    Next

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

    For $i = 4 To 7
    GUICtrlSetState($aXmm0[$i][0], $GUI_HIDE)
    GUICtrlSetState($aXmm1[$i][0], $GUI_HIDE)
    Next

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

    Case GUICtrlRead($cRB_SHUFPD) = 1
    Local $iSize = ($iWidth - 20) / 4
    For $i = 0 To 1
    GUICtrlSetState($aXmm0[$i][0], BitOR($GUI_SHOW, $GUI_ENABLE))
    $aXmm0[$i][1] = $iWidth * 0.5 - ($i + 1) * $iSize
    $aXmm0[$i][2] = $iSize
    GUICtrlSetPos($aXmm0[$i][0], $aXmm0[$i][1] + 2, $iYPosXMM, $aXmm0[$i][2] - 4, 20)

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

    GUICtrlSetState($aXmm1[$i][0], BitOR($GUI_SHOW, $GUI_ENABLE))
    $aXmm1[$i][1] = $iWidth * 0.5 + $iSize - $i * $iSize
    $aXmm1[$i][2] = $iSize
    GUICtrlSetPos($aXmm1[$i][0], $aXmm1[$i][1] + 2, $iYPosXMM, $aXmm1[$i][2] - 4, 20)
    Next

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

    For $i = 2 To 7
    GUICtrlSetState($aXmm0[$i][0], $GUI_HIDE)
    GUICtrlSetState($aXmm1[$i][0], $GUI_HIDE)
    Next

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

    Case (GUICtrlRead($cRB_PSHUFLW) = 1) Or (GUICtrlRead($cRB_PSHUFHW) = 1)
    Local $iSize = ($iWidth - 20) / 16
    For $i = 0 To 7
    GUICtrlSetState($aXmm0[$i][0], $GUI_HIDE)

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

    GUICtrlSetState($aXmm1[$i][0], BitOR($GUI_SHOW, $GUI_ENABLE))
    $aXmm1[$i][1] = $iWidth * 0.5 + $iSize * 3 - $i * $iSize
    $aXmm1[$i][2] = $iSize
    GUICtrlSetPos($aXmm1[$i][0], $aXmm1[$i][1] + 2, $iYPosXMM, $aXmm1[$i][2] - 4, 20)
    Next
    If GUICtrlRead($cRB_PSHUFLW) = 1 Then
    For $i = 4 To 7
    GUICtrlSetState($aXmm1[$i][0], $GUI_DISABLE)
    Next
    Else
    For $i = 0 To 3
    GUICtrlSetState($aXmm1[$i][0], $GUI_DISABLE)
    Next
    EndIf

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

    EndSelect

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

    Select
    Case (GUICtrlRead($cRB_SHUFPS) = 1) Or (GUICtrlRead($cRB_SHUFPD) = 1)
    Local $iSize = ($iWidth - 20) / 4
    GUICtrlSetState($aInf[0], BitOR($GUI_SHOW, $GUI_ENABLE))
    GUICtrlSetState($aInf[1], BitOR($GUI_SHOW, $GUI_ENABLE))
    GUICtrlSetPos($aInf[0], $iWidth / 2 - $iSize * 2 + 2, $iYPosXMM - 20, $iSize * 2 - 4, 14)
    GUICtrlSetPos($aInf[1], $iWidth / 2 + 2, $iYPosXMM - 20, $iSize * 2 - 4, 14)

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

    Case Else
    Local $iSize = ($iWidth - 20) / 4
    GUICtrlSetState($aInf[0], $GUI_HIDE)
    GUICtrlSetState($aInf[1], BitOR($GUI_SHOW, $GUI_ENABLE))
    GUICtrlSetPos($aInf[1], $iWidth / 2 - $iSize + 2, $iYPosXMM - 20, $iSize * 2 - 4, 14)

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

    EndSelect

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

    _CalcShufle()
    EndFunc ;==>_SetMode

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

    Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    Local $iIDFrom = BitAND($wParam, 0xFFFF)
    Local $iCode = BitShift($wParam, 16)

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

    Local $sText

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

    If $iCode = $EN_CHANGE Then
    Switch $iIDFrom
    Case $cIP_Bin
    $sText = StringRight(StringRegExpReplace(GUICtrlRead($cIP_Bin), "[^01]", ""), 8)
    GUICtrlSetData($cIP_Bin, $sText)

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

    $sText = "0x" & StringFormat("%02s", StringUpper(_TranslateBase($sText, 2, 16)))
    GUICtrlSetData($cIP_Hex, $sText)

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

    _CalcShufle()

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

    Case $cIP_Hex
    $sText = StringRight(StringUpper(StringRegExpReplace(StringTrimLeft(GUICtrlRead($cIP_Hex), 2), "[^[:xdigit:]]", "")), 2)
    GUICtrlSetData($cIP_Hex, "0x" & $sText)

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

    $sText = StringFormat("%08s", _TranslateBase($sText, 16, 2))
    GUICtrlSetData($cIP_Bin, $sText)

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

    _CalcShufle()

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

    EndSwitch
    EndIf
    EndFunc ;==>WM_COMMAND

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

    Func _TranslateBase($sNumber, $iOldBase = 10, $iNewBase = 2)
    ;by eukalyptus
    If $iOldBase < 2 Or $iOldBase > 128 Or $iNewBase < 2 Or $iNewBase > 128 Then Return SetError(1, 1, False)
    Local $iNum, $aRes, $tChr = DllStructCreate("char[64];")
    If $iOldBase <> 10 Then
    $aRes = DllCall("msvcrt.dll", "uint64:cdecl", "_strtoui64", "str", $sNumber, "ptr", 0, "int", $iOldBase)
    If @error Then Return SetError(1, 2, False)
    $iNum = $aRes[0]
    Else
    $iNum = Int($sNumber)
    EndIf
    $aRes = DllCall("msvcrt.dll", "ptr:cdecl", "_i64toa", "int64", $iNum, "ptr", DllStructGetPtr($tChr), "int", $iNewBase)
    If @error Then Return SetError(1, 3, False)
    Return DllStructGetData($tChr, 1)
    EndFunc ;==>_TranslateBase

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

    Func _Exit()
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.


    Download: Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    E

    Dateien

    Shuffle.JPG 64,6 kB – 0 Downloads SSE_Shuffle.exe 703,26 kB – 420 Downloads
  • GDI+ Textrendering (BB-Code)

    • eukalyptus
    • 26. Juli 2013 um 18:30

    Ich hab ein Beispiel erstellt, das verschiende Möglichkeiten der Stringabmessung zeigen soll:

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    #include <StructureConstants.au3>
    #include <WindowsConstants.au3>

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

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

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

    _GDIPlus_Startup()

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

    Global $iWidth = 1200
    Global $iHeight = 700

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

    Global $hGui = GUICreate("Test", $iWidth, $iHeight)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
    Global $hBmpBuffer = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics)
    Global $hGfxBuffer1 = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer)
    _GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer1, 2)
    GUIRegisterMsg($WM_PAINT, "_WM_PAINT")
    GUISetState()

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

    _GDIPlus_GraphicsClear($hGfxBuffer1, 0xFFFFFFFF)
    _Test($hGfxBuffer1, "abcdefg", "Arial", 30, 10, 90)
    _Test($hGfxBuffer1, "abcdefg", "Courier New", $iWidth / 2, 10, 90)

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

    For $i = 97 To 103
    _Test($hGfxBuffer1, Chr($i), "Arial", 30 + ($i - 97) * 150, 230, 60)
    Next

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

    _Test($hGfxBuffer1, "abcdefg", "Arial", 30, 470, 20)
    _Test($hGfxBuffer1, "abcdefg", "Courier New", 30, 570, 20)

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

    _Test($hGfxBuffer1, "ÁA", "Arial", 300, 370, 180)
    _Test($hGfxBuffer1, "Q", "Courier New", 900, 370, 180)

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

    _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)

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

    While Sleep(10)
    WEnd

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

    Func _Test($hGraphics, $sString, $sFont, $iX, $iY, $fSize, $iStyle = 0)
    Local $fX, $fY, $fW, $fH

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

    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipGetDpiY", "hwnd", $hGraphics, "float*", 0)
    Local $fDPIY = $aResult[2]

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

    Local $hPenR = _GDIPlus_PenCreate(0xFFFF0000)
    Local $hPenG = _GDIPlus_PenCreate(0xFF00FF00)
    Local $hPenB = _GDIPlus_PenCreate(0xFF0000FF)
    Local $hPenY = _GDIPlus_PenCreate(0xFFFFBB00)

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

    Local $hBrushR = _GDIPlus_BrushCreateSolid(0x88FF0000)
    Local $hBrushG = _GDIPlus_BrushCreateSolid(0x8800FF00)
    Local $hBrushB = _GDIPlus_BrushCreateSolid(0x880000FF)
    Local $hBrushY = _GDIPlus_BrushCreateSolid(0x44FFBB00)

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

    Local $hFormat = _GDIPlus_StringFormatCreate()
    Local $hFamily = _GDIPlus_FontFamilyCreate($sFont)
    Local $tLayout = _GDIPlus_RectFCreate($iX, $iY, 0, 0)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $fSize, $iStyle)

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

    DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "hwnd", $hGraphics, "int", 4)

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

    ;Messen via MeasureString:
    Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $sString, $hFont, $tLayout, $hFormat)
    _GDIPlus_GraphicsDrawStringEx($hGraphics, $sString, $hFont, $aInfo[0], $hFormat, $hBrushG)

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

    $fX = DllStructGetData($aInfo[0], "X")
    $fY = DllStructGetData($aInfo[0], "Y")
    $fW = DllStructGetData($aInfo[0], "Width")
    $fH = DllStructGetData($aInfo[0], "Height")
    DllCall($ghGDIPDll, "int", "GdipDrawRectangle", "handle", $hGraphics, "handle", $hPenG, "float", $fX, "float", $fY, "float", $fW, "float", $fH)

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

    ;Char Höhe auslesen:
    $aResult = DllCall($ghGDIPDll, "uint", "GdipGetEmHeight", "hwnd", $hFamily, "int", $iStyle, "ushort*", 0)
    Local $iEMHeight = $aResult[3]

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipGetCellAscent", "hwnd", $hFamily, "int", $iStyle, "ushort*", 0)
    Local $fAsc = Ceiling(($fSize / $iEMHeight * $aResult[3]) * $fDPIY / 72)

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipGetCellDescent", "hwnd", $hFamily, "int", $iStyle, "ushort*", 0)
    Local $fDesc = Ceiling(($fSize / $iEMHeight * $aResult[3]) * $fDPIY / 72)

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipGetLineSpacing", "hwnd", $hFamily, "int", $iStyle, "ushort*", 0)
    Local $fLnSpac = Ceiling(($fSize / $iEMHeight * $aResult[3]) * $fDPIY / 72)

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

    $fX = $iX
    $fY = $iY + $fAsc
    $fH = 0
    DllCall($ghGDIPDll, "int", "GdipDrawLine", "handle", $hGraphics, "handle", $hPenR, "float", $fX, "float", $fY, "float", $fX + $fW + 50, "float", $fY + $fH)

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

    $fX += $fW + 10
    $fY = $iY
    $fW = 0
    $fH = $fAsc
    DllCall($ghGDIPDll, "int", "GdipDrawLine", "handle", $hGraphics, "handle", $hPenR, "float", $fX, "float", $fY, "float", $fX + $fW, "float", $fY + $fH)

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

    $fX += 10
    $fY += $fAsc
    $fH = $fDesc
    DllCall($ghGDIPDll, "int", "GdipDrawLine", "handle", $hGraphics, "handle", $hPenR, "float", $fX, "float", $fY, "float", $fX + $fW, "float", $fY + $fH)

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

    $fX += 10
    $fY = $iY
    $fH = $fLnSpac
    DllCall($ghGDIPDll, "int", "GdipDrawLine", "handle", $hGraphics, "handle", $hPenR, "float", $fX, "float", $fY, "float", $fX + $fW, "float", $fY + $fH)

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

    ;Box Größe auslesen:
    Local $tRanges = DllStructCreate("int Pos; int Cnt;")
    DllStructSetData($tRanges, "Pos", 0)
    DllStructSetData($tRanges, "Cnt", StringLen($sString))

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

    DllCall($ghGDIPDll, "uint", "GdipSetStringFormatMeasurableCharacterRanges", "hwnd", $hFormat, "int", 1, "ptr", DllStructGetPtr($tRanges))

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipGetStringFormatMeasurableCharacterRangeCount", "hwnd", $hFormat, "int*", 0)
    Local $iCount = $aResult[2]
    If $iCount >= 1 Then
    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateRegion", "int*", 0)
    Local $hRegion = $aResult[1]

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipMeasureCharacterRanges", "hwnd", $hGraphics, "wstr", $sString, "int", -1, "hwnd", $hFont, "ptr", DllStructGetPtr($aInfo[0]), "hwnd", $hFormat, "int", 1, "hwnd*", $hRegion)

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

    Local $tBounds = DllStructCreate($tagGDIPRECTF)
    $aResult = DllCall($ghGDIPDll, "uint", "GdipGetRegionBounds", "hwnd", $hRegion, "hwnd", $hGraphics, "ptr", DllStructGetPtr($tBounds))

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

    DllCall($ghGDIPDll, "uint", "GdipFillRegion", "hwnd", $hGraphics, "hwnd", $hBrushY, "hwnd", $hRegion)

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

    DllCall($ghGDIPDll, "uint", "GdipDeleteRegion", "hwnd", $hRegion)

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

    $fX = DllStructGetData($tBounds, "X")
    $fY = DllStructGetData($tBounds, "Y")
    $fW = DllStructGetData($tBounds, "Width")
    $fH = DllStructGetData($tBounds, "Height")
    DllCall($ghGDIPDll, "int", "GdipDrawRectangle", "handle", $hGraphics, "handle", $hPenY, "float", $fX, "float", $fY, "float", $fW, "float", $fH)
    EndIf

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

    ;Messen via Path
    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePath", "int", 0, "int*", 0)
    Local $hPath = $aResult[2]

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

    DllCall($ghGDIPDll, "uint", "GdipAddPathString", "hwnd", $hPath, "wstr", $sString, "int", -1, "hwnd", $hFamily, "int", $iStyle, "float", $fSize * $fDPIY / 72, "ptr", DllStructGetPtr($tLayout), "hwnd", $hFormat)

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

    Local $tBounds = DllStructCreate($tagGDIPRECTF)
    $aResult = DllCall($ghGDIPDll, "uint", "GdipGetPathWorldBounds", "hwnd", $hPath, "struct*", $tBounds, "hwnd", 0, "hwnd", 0)

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

    DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGraphics, "hwnd", $hPenB, "hwnd", $hPath)

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

    $fX = DllStructGetData($tBounds, "X")
    $fY = DllStructGetData($tBounds, "Y")
    $fW = DllStructGetData($tBounds, "Width")
    $fH = DllStructGetData($tBounds, "Height")
    DllCall($ghGDIPDll, "int", "GdipDrawRectangle", "handle", $hGraphics, "handle", $hPenB, "float", $fX, "float", $fY, "float", $fW, "float", $fH)
    DllCall($ghGDIPDll, "uint", "GdipDeletePath", "hwnd", $hPath)

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

    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)

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

    _GDIPlus_BrushDispose($hBrushR)
    _GDIPlus_BrushDispose($hBrushG)
    _GDIPlus_BrushDispose($hBrushB)
    _GDIPlus_BrushDispose($hBrushY)
    _GDIPlus_PenDispose($hPenR)
    _GDIPlus_PenDispose($hPenG)
    _GDIPlus_PenDispose($hPenB)
    _GDIPlus_PenDispose($hPenY)
    EndFunc ;==>_Test

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

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

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

    Func _Exit()
    _GDIPlus_GraphicsDispose($hGfxBuffer1)
    _GDIPlus_BitmapDispose($hBmpBuffer)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    GUIDelete($hGui)
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    Der String wird mit DrawString in Grün gezeichnet. Der Umriß in Blau ist der String in einem Path.
    Achtung! Drawstring und PathString sind unterschiedlich breit! (zwar nur minimal, aber doch merkbar)

    Das grüne Rechteck ist der Bereich, welcher via _GDIPlus_GraphicsMeasureString berechnet wird.
    Die roten Linien zeigen die Höhe der Schrift: Ascent, Descent und LineSpacing
    Der gelbe Bereich zeigt die "Box" der Schrift an (diese Methode funktioniert auch Zeilenübergrifend und kann z.B. zum Markieren einer Textstelle verwendet werden)
    Das blaue Rechteck zeigt die tatsächliche Größe der Buchstaben. (Zeigt die Größe der Schrift im Path und entspricht leider nicht "ganz" genau der Breite von _GDIPlus_GraphicsDrawStringEx (noch größere Abweichung, wenn man GdipSetTextRenderingHint verändert!))

    lgE

  • GDI+ Anzeige von Bildern fehlerhaft bei wechselnder Grösse / Performance Tips gesucht

    • eukalyptus
    • 12. Juli 2013 um 06:18

    Die RegisterMsg-Funktionen müssen so schnell wie möglich abgearbeitet werden.
    Die Funktion _Show braucht zu lange und sollte deshalb nicht in _WM_MOUSEWHEEL aufgerufen werden.

    Des weiteren brauchen diese Funktionen noch den Rückgabewert $GUI_RUNDEFMSG

    Du kannst _Show() in _WM_MOUSEWHEEL allerdings so aufrufen:

    [autoit]

    AdlibRegister("_Show", 250)
    Return $GUI_RUNDEFMSG

    [/autoit]

    und in der ersten Zeile von _Show:

    [autoit]

    AdlibUnRegister("_Show")

    [/autoit]

    Beim Wiederherstellen hilft

    [autoit]

    GUIRegisterMsg($WM_ERASEBKGND, "_WM_ERASEBKGND")

    [/autoit]


    wobei diese Funktion genau wie _WM_PAINT aussieht, mit dem Unterschied, dass du TRUE statt $GUI_RUNDEFMSG als Rückgabewert verwendest

    E

  • n-Body Simulation -> 64-Bit-Assembler + MultiThread + AssembleIt2() Update Benchmark

    • eukalyptus
    • 7. Juli 2013 um 15:08

    Probiers mal mit 8 Threads (Zeile 21)

  • n-Body Simulation -> 64-Bit-Assembler + MultiThread + AssembleIt2() Update Benchmark

    • eukalyptus
    • 7. Juli 2013 um 07:41

    Hier meine Werte:

    Code
    Benchmark n-Body-Simulation
    
    
    Number Particles:		30000
    Processor:		Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
    Number Processors(Cores):	4
    Number Threads:		4
    Overall Time:		544.22 Seconds
    Number Loops benchmarked:	1033
    
    
    Average Interacts/sec:	7.00e+009
    Maximum Interacts/sec:	7.60e+009
    
    
    Average Ticks/Interact:	24.04    CAUTION! Depends on real Clockticks!
    Minimum Ticks/Interact:	22.6    CAUTION! Depends on real Clockticks!
    
    
    Average Clockticks[Mhz]:	2801    CAUTION! Clockticks may NOT match if over/underclocked! Please insert the real Clockticks!
    Maximum Clockticks[Mhz]:	2801    CAUTION! Clockticks may NOT match if over/underclocked! Please insert the real Clockticks!
    
    
    Average Looptime:		520.35 Milliseconds
    Fastest Looptime:		473.42 Milliseconds
    Alles anzeigen

    Bei einem älteren Laptop stürzt das Script ab, ich habe aber den Übeltäter gefunden:
    Wenn ich rdtscp herausnehme, dann läuft das Script - allerdings ohne Benchmark.

    E

  • n-Body Simulation -> 64-Bit-Assembler + MultiThread + AssembleIt2() Update Benchmark

    • eukalyptus
    • 3. Juli 2013 um 04:12

    DAS ist ja wieder mal geil :rock:

    Leider entäuscht mein Laptop bei der Performance:
    3.2e009 Interaktionen/Sekunde und 49 Takte/Interaktion
    Intel Core i7-2640M

    Vielen Dank für die neue AssembleIt!

  • Regex Herausforderung

    • eukalyptus
    • 11. Juni 2013 um 19:04

    So:

    [autoit]

    #include <Array.au3>
    $sStr = 'Abcdef"ghi"jklmno"pqrstuvw"xyz'

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

    $aRegEx = StringRegExp($sStr, '["][^"]*["]|\w+', 3)
    _ArrayDisplay($aRegEx)

    [/autoit]

    E

  • Sinus Sweep berechnen?

    • eukalyptus
    • 8. Juni 2013 um 12:23

    Danke!

    bevor ich die Formeln verstehe, werden wohl noch ein paar Sonnen untergehen ;)
    Für meine Zwecke reicht es momentan

    thx
    E

  • GDI+ auf GUI & Datei

    • eukalyptus
    • 8. Juni 2013 um 12:18

    Du musst ein Bitmap statt eines GUI verwenden, um das Bild zu erstellen:

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>

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

    Dim $File_Background = '' ;Pfad zur Hintergrunddatei
    Dim $File_Transparent = '' ;Pfad für Transparente Datei für den Vordergrund

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

    Dim $Draw_BackgroundFile = True ;Hintergrundbild oder nur Farbe zeichnen

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

    $hGui = GUICreate('sichtbare GUI', 500, 300)
    GUISetState()
    _GDIPlus_Startup()

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

    $hDrawBitmap = _GDIPlus_BitmapCreateFromScan0(1280, 720)
    $hDrawContext = _GDIPlus_ImageGetGraphicsContext($hDrawBitmap)

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

    $hgraphics_hGui = _GDIPlus_GraphicsCreateFromHWND($hGui)

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

    $Image_Picture = _GDIPlus_ImageLoadFromFile($File_Transparent)
    $Image_Background = _GDIPlus_ImageLoadFromFile($File_Background)
    $hBrush = _GDIPlus_BrushCreateSolid(0xff00ff00)

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

    If $Draw_BackgroundFile = True Then
    _GDIPlus_GraphicsDrawImageRect($hDrawContext, $Image_Background, 0, 0, 1280, 720)
    Else
    _GDIPlus_GraphicsFillRect($hDrawContext,0,0,1280,720,$hBrush)
    EndIf

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

    _GDIPlus_GraphicsDrawImageRect($hDrawContext,$Image_Picture,0,0,1280,720)
    _GDIPlus_GraphicsDrawString($hDrawContext, 'Test String',10,10,'Arial',100)

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

    _GDIPlus_GraphicsDrawImageRect($hgraphics_hGui, $hDrawBitmap, 50,50,400,400/16*9) ; nun alles auf die sichtbare GUI zeichnen
    _GDIPlus_ImageSaveToFile($hDrawBitmap,@ScriptDir&'\Test.jpg')

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

    _GDIPlus_GraphicsDispose($Image_Picture)
    _GDIPlus_GraphicsDispose($Image_Background)
    _GDIPlus_GraphicsDispose($hDrawContext)
    _GDIPlus_BitmapDispose($hDrawBitmap)
    _GDIPlus_BitmapDispose($Image_Background)
    _GDIPlus_BitmapDispose($Image_Picture)
    _GDIPlus_GraphicsDispose($hgraphics_hGui)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_Shutdown()

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

    Sleep(2500)

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_BitmapCreateFromScan0
    ; Description ...: Creates a Bitmap object based on an array of bytes along with size and format information
    ; Syntax.........: _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight[, $iStride = 0[, $iPixelFormat = 0x0026200A[, $pScan0 = 0]]])
    ; Parameters ....: $iWidth - The bitmap width, in pixels
    ; $iHeight - The bitmap height, in pixels
    ; $iStride - Integer that specifies the byte offset between the beginning of one scan line and the next. This
    ; +is usually (but not necessarily) the number of bytes in the pixel format (for example, 2 for 16 bits per pixel)
    ; +multiplied by the width of the bitmap. The value passed to this parameter must be a multiple of four
    ; $iPixelFormat - Specifies the format of the pixel data. Can be one of the following:
    ; |$GDIP_PXF01INDEXED - 1 bpp, indexed
    ; |$GDIP_PXF04INDEXED - 4 bpp, indexed
    ; |$GDIP_PXF08INDEXED - 8 bpp, indexed
    ; |$GDIP_PXF16GRAYSCALE - 16 bpp, grayscale
    ; |$GDIP_PXF16RGB555 - 16 bpp; 5 bits for each RGB
    ; |$GDIP_PXF16RGB565 - 16 bpp; 5 bits red, 6 bits green, and 5 bits blue
    ; |$GDIP_PXF16ARGB1555 - 16 bpp; 1 bit for alpha and 5 bits for each RGB component
    ; |$GDIP_PXF24RGB - 24 bpp; 8 bits for each RGB
    ; |$GDIP_PXF32RGB - 32 bpp; 8 bits for each RGB. No alpha.
    ; |$GDIP_PXF32ARGB - 32 bpp; 8 bits for each RGB and alpha
    ; |$GDIP_PXF32PARGB - 32 bpp; 8 bits for each RGB and alpha, pre-mulitiplied
    ; $pScan0 - Pointer to an array of bytes that contains the pixel data. The caller is responsible for
    ; +allocating and freeing the block of memory pointed to by this parameter.
    ; Return values .: Success - Returns a handle to a new Bitmap object
    ; Failure - 0 and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: After you are done with the object, call _GDIPlus_ImageDispose to release the object resources
    ; Related .......: _GDIPlus_ImageDispose
    ; Link ..........; @@MsdnLink@@ GdipCreateBitmapFromScan0
    ; Example .......; Yes
    ; ===============================================================================================================================
    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)

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

    If @error Then Return SetError(@error, @extended, 0)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[6]
    EndFunc ;==>_GDIPlus_BitmapCreateFromScan0

    [/autoit]

    E

  • Sinus Sweep berechnen?

    • eukalyptus
    • 7. Juni 2013 um 00:25

    Danke! Das hat schonmal sehr geholfen!

    Aber ganz korrekt ist deine Berechnung auch nicht.
    Wenn du in deiner Darstellung den Zeitbereich von 2.5 bis 3 betrachtest, dann siehst du dort etwa 4 Schwingungen = 8 Schwingungen / Sekunde

    Deshalb musste ich "m" noch durch 2 Teilen um am Ende auf 4 Hz zu kommen.

    Warum ist das so?


    Hier mein Script dazu:

    Spoiler anzeigen
    [autoit]

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

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

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

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

    Global Const $cPI = ATan(1) * 4
    Global Const $c2PI = $cPI * 2

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

    _GDIPlus_Startup()

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

    Global $iWidth = 800
    Global $iHeight = 600

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

    Global $hGui = GUICreate("AutoIt GDI+", $iWidth, $iHeight)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
    Global $hBmpBuffer = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics)
    Global $hGfxBuffer = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer)
    _GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer, 2)
    _GDIPlus_GraphicsClear($hGfxBuffer, 0xFFFFFFFF)

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

    Global $hPen_R = _GDIPlus_PenCreate(0xFFFF0000)
    Global $hPen_G = _GDIPlus_PenCreate(0xFF00FF00)

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

    GUIRegisterMsg($WM_PAINT, "_WM_PAINT")
    GUISetState()

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

    Global $fFreqS = 1
    Global $fFreqE = 4
    Global $fTime = 3

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

    _DrawSine($fFreqS, $fTime, $iHeight * 0.25)
    _DrawSine($fFreqE, $fTime, $iHeight * 0.5)
    _DrawSineSweep($fFreqS, $fFreqE, $fTime, $iHeight * 0.75)

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

    While 1
    Sleep(10)
    WEnd

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

    Func _DrawSineSweep($fFreqS, $fFreqE, $fTime, $fYOff, $fAmp = 20)
    Local $fS, $fX1, $fY1, $fX2, $fY2
    $fX1 = 0
    $fY1 = $fYOff

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

    Local $iSteps = 2000
    Local $fW = $iWidth / $iSteps
    Local $fT = $fTime / $iSteps
    Local $fTmp, $fVal1, $fVal2

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

    $fVal1 = ($fFreqE - $fFreqS) / ($fTime)
    $fVal2 = $fFreqE - $fVal1 * $fTime
    $fVal1 /= 2

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

    ConsoleWrite("! " & $fVal1 & @CRLF)
    ConsoleWrite("! " & $fVal2 & @CRLF)

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

    For $i = 0 To $iSteps
    $fTmp = ($i * $fT)
    $fS = Sin($c2PI * $fTmp * ($fVal1 * $fTmp + $fVal2)) * $fAmp

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

    $fX2 = $i * $fW
    $fY2 = $fYOff + $fS
    DllCall($ghGDIPDll, "int", "GdipDrawLine", "handle", $hGfxBuffer, "handle", $hPen_R, "float", $fX1, "float", $fY1, "float", $fX2, "float", $fY2)
    DllCall($ghGDIPDll, "int", "GdipDrawEllipse", "handle", $hGfxBuffer, "handle", $hPen_G, "float", $fX2 - 1, "float", $fY2 - 1, "float", 2, "float", 2)
    $fX1 = $fX2
    $fY1 = $fY2
    Next
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
    EndFunc ;==>_DrawSineSweep

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

    Func _DrawSine($fFreq, $fTime, $fYOff, $fAmp = 20)
    Local $fS, $fX1, $fY1, $fX2, $fY2
    $fX1 = 0
    $fY1 = $fYOff

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

    Local $iSteps = 2000
    Local $fW = $iWidth / $iSteps
    Local $fT = $fTime / $iSteps
    Local $fTmp

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

    For $i = 0 To $iSteps
    $fTmp = ($i * $fT)
    $fS = Sin($c2PI * $fTmp * $fFreq) * $fAmp

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

    $fX2 = $i * $fW
    $fY2 = $fYOff + $fS
    DllCall($ghGDIPDll, "int", "GdipDrawLine", "handle", $hGfxBuffer, "handle", $hPen_R, "float", $fX1, "float", $fY1, "float", $fX2, "float", $fY2)
    DllCall($ghGDIPDll, "int", "GdipDrawEllipse", "handle", $hGfxBuffer, "handle", $hPen_G, "float", $fX2 - 1, "float", $fY2 - 1, "float", 2, "float", 2)
    $fX1 = $fX2
    $fY1 = $fY2
    Next
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
    EndFunc ;==>_DrawSine

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

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

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

    Func _Exit()
    _GDIPlus_PenDispose($hPen_R)
    _GDIPlus_PenDispose($hPen_G)

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

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

    [/autoit]

    Danke
    E

  • Sinus Sweep berechnen?

    • eukalyptus
    • 5. Juni 2013 um 10:13

    Hi

    Ich will einen Sinus-Verlauf berechnen z.B.: 110Hz - 440Hz
    Das Ergebnis ist leider nicht korrekt: Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Die ersten 4 Wellen sind richtig und zeigen eine Sinuskurve in 110, 220, 440 u 880Hz
    Die letzten 3 sind Sweeps und sollten jeweils bis 440Hz gehen, allerdings ist die Wellenlänge am Ende deutlich kürzer als erwartet.

    Weiß jemand, wie man solche Sweeps berechnet?


    Ein möglicher Lösungsansatz wäre:
    Immer eine ganze Schwingung mit gleicher Frequenz berechnen. Wellenlänge = Lambda = Samplerate / Frequenz.
    Die nächste Schwingung beginnt wieder im Nulldurchgang (Step (in meinem Script "$j") beginnt jedesmal wieder bei 0)
    Das ist dann aber kein linearer Verlauf mehr!

    Es muss doch eine einfache Lösung geben?!

    Vielen Dank!

    Spoiler anzeigen
    [autoit]

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

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

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

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

    Global Const $cPI = ATan(1) * 4
    Global Const $c2PI = $cPI * 2

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

    _GDIPlus_Startup()

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

    Global $iWidth = 800
    Global $iHeight = 600

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

    Global $hGui = GUICreate("AutoIt GDI+", $iWidth, $iHeight)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
    Global $hBmpBuffer = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics)
    Global $hGfxBuffer = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer)
    _GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer, 2)
    _GDIPlus_GraphicsClear($hGfxBuffer, 0xFFFFFFFF)

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

    Global $hPen = _GDIPlus_PenCreate(0xFFFF0000)

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

    GUIRegisterMsg($WM_PAINT, "_WM_PAINT")
    GUISetState()

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

    Global $tSine

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

    Global $aHz[3][2] = [[2]]
    $aHz[1][0] = 110
    $aHz[1][1] = 1
    $aHz[2][0] = 110
    $aHz[2][1] = 2000
    $tSine = _SineSweep($aHz)
    _DrawSine($aHz, $tSine, 80)

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

    $aHz[1][0] = 220
    $aHz[2][0] = 220
    $tSine = _SineSweep($aHz)
    _DrawSine($aHz, $tSine, 160)

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

    $aHz[1][0] = 440
    $aHz[2][0] = 440
    $tSine = _SineSweep($aHz)
    _DrawSine($aHz, $tSine, 240)

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

    $aHz[1][0] = 880
    $aHz[2][0] = 880
    $tSine = _SineSweep($aHz)
    _DrawSine($aHz, $tSine, 320)

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

    $aHz[1][0] = 110
    $aHz[2][0] = 440
    $tSine = _SineSweep($aHz)
    _DrawSine($aHz, $tSine, 400)

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

    Global $aHz[4][2] = [[3]]
    $aHz[1][0] = 110
    $aHz[1][1] = 1
    $aHz[2][0] = 220
    $aHz[2][1] = 1000
    $aHz[3][0] = 440
    $aHz[3][1] = 2000

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

    $tSine = _SineSweep($aHz)
    _DrawSine($aHz, $tSine, 480)

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

    $aHz[1][0] = 110
    $aHz[2][0] = 110
    $aHz[3][0] = 440

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

    $tSine = _SineSweep($aHz)
    _DrawSine($aHz, $tSine, 560)

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

    While 1
    Sleep(10)
    WEnd

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

    Func _DrawSine($aHz, $tSine, $iY, $fAmp = 16)
    Local $iSamples = DllStructGetData($tSine, "Cnt")
    Local $tCurve = DllStructCreate("float[" & $iSamples * 2 & "]")
    Local $fTmp

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

    For $i = 1 To $iSamples
    $fTmp = DllStructGetData($tSine, "Sine", $i) * $fAmp
    DllStructSetData($tCurve, 1, ($i - 1) / $iSamples * $iWidth, ($i - 1) * 2 + 1)
    DllStructSetData($tCurve, 1, $fTmp + $iY, ($i - 1) * 2 + 2)
    Next

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

    DllCall($ghGDIPDll, "uint", "GdipDrawCurve2", "hwnd", $hGfxBuffer, "hwnd", $hPen, "ptr", DllStructGetPtr($tCurve), "int", $iSamples, "float", 0.5)

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

    For $i = 1 To $aHz[0][0]
    _GDIPlus_GraphicsDrawString($hGfxBuffer, $aHz[$i][0] & "Hz", $aHz[$i][1] / $iSamples * ($iWidth - 40), $iY - $fAmp - 16)
    Next

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

    _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
    EndFunc ;==>_DrawSine

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

    Func _SineSweep($aHz, $fRate = 44100.0)
    Local $iCnt = $aHz[0][0]
    Local $iSamples = $aHz[$iCnt][1]

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

    Local $tSine = DllStructCreate("int Cnt; float Sine[" & $iSamples & "]")
    DllStructSetData($tSine, "Cnt", $iSamples)

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

    Local $fHZ_Start, $fHZ_End
    Local $iSmp_Start, $iSmp_End

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

    Local $fTmp, $fS

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

    For $i = 1 To $iCnt - 1
    $fHZ_Start = $aHz[$i][0]
    $fHZ_End = $aHz[$i + 1][0]
    ConsoleWrite("> Sweep: " & $fHZ_Start & "Hz -> " & $fHZ_End & "Hz" & " | " & $aHz[$i][1] & " -> " & $aHz[$i + 1][1] & @CRLF)

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

    For $j = $aHz[$i][1] To $aHz[$i + 1][1]
    $fTmp = $fHZ_Start + (($fHZ_End - $fHZ_Start) * ($j - $aHz[$i][1]) / ($aHz[$i + 1][1] - $aHz[$i][1]))
    ConsoleWrite("! Hz: " & $fTmp & @CRLF)
    $fS = Sin($j * $c2PI / ($fRate / $fTmp))
    DllStructSetData($tSine, "Sine", $fS, $j)
    Next
    Next

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

    Return $tSine
    EndFunc ;==>_SineSweep

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

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

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

    Func _Exit()
    _GDIPlus_PenDispose($hPen)

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

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

    [/autoit]

    Dateien

    Sine.JPG 56,88 kB – 0 Downloads
  • Icons mit _WinAPI_ExtractIconEx aus .dll, .exe etc. extrahieren

    • eukalyptus
    • 29. Mai 2013 um 23:53

    Hier eine Funktion um transparente Icons in GDI+ verwenden zu können: [ gelöst ] GDI+ unterschiedliche Icon-Transparenz

    E

  • StringReplace mit RegExp-Pattern und Manipulation jedes Matches per Iteration

    • eukalyptus
    • 23. Mai 2013 um 01:43

    Für das letzte bisschen Performance hab ich noch eine optimierte Variante anzubieten:

    [autoit]

    Func _StrReplaceIterated($sS)
    Local $sRE = StringRegExpReplace($sS, "(\[)(\d+)(\])", "$1" & Chr(1) & "$2" & Chr(1) & "$3")
    Local $aS = StringSplit($sRE, Chr(1))
    Local $sO = ""

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

    For $i = 1 To $aS[0] - 1 Step 2
    $sO &= $aS[$i] & $aS[$i + 1] * 1000
    Next
    $sO &= $aS[$aS[0]]

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

    Return SetError(0, $aS[0] / 2, $sO)
    EndFunc ;==>_StrReplaceIterated

    [/autoit]

    Die Berechnung erfolgt innerhalb der Funktion und funktioniert deshalb nur für diesen Einsatzzweck!
    Deshalb ist auch Taz´s Version die bessere!

    Taz77: WOW - die Funktion ist wirklich sehr gut! :rock:

    E

  • StringReplace mit RegExp-Pattern und Manipulation jedes Matches per Iteration

    • eukalyptus
    • 22. Mai 2013 um 06:55

    Hi

    Hier ein weiterer Ansatz:

    [autoit]

    Func _StrReplaceIterated($_s, $_sPatt, $_sReplFunc)
    Local $sRE_Rep = StringRegExpReplace($_s, $_sPatt, Chr(1) & "$1" & Chr(1))
    Local $aSplit = StringSplit($sRE_Rep, Chr(1))
    Local $sOut = ""

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

    For $i = 1 To $aSplit[0] - 1 Step 2
    $sOut &= $aSplit[$i] & Call($_sReplFunc, $aSplit[$i + 1])
    Next
    $sOut &= $aSplit[$aSplit[0]]

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

    Return SetError(0, $aSplit[0] / 2, $sOut)
    EndFunc ;==>_StrReplaceIterated

    [/autoit]

    lgE

  • AutoIT Bug? Rechenfehler? Denkfehler??? Was läuft hier schief?

    • eukalyptus
    • 18. Mai 2013 um 05:53

    Der Rückgabewert einer Inputbox ist vom Typ "String" und muss zuerst ein eine Zahl umgewandelt werden (z.B.: Number, Int, Round).

    [autoit]

    Local $ergebnis
    Do
    $x = Number(InputBox("X", "Ergebnis der letzten Eingabe:" & @CR & @CR & $ergebnis))
    $y = Number(InputBox("Y", "Ergebnis der letzten Eingabe:" & @CR & @CR & $ergebnis))

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

    If $y > $x Then
    $ergebnis = $y & " > " & $x
    ElseIf $x > $y Then
    $ergebnis = $x & " > " & $y
    Else
    $ergebnis = $x & " = " & $y
    EndIf
    Until @error = 1 Or $y = ""

    [/autoit]

    E

  • GDI+ AutoIt Logo

    • eukalyptus
    • 3. Mai 2013 um 09:26
    Zitat von UEZ

    Was hattest du denn eigentlich machen wollen?


    Ich wollte das Logo in 3D machen und an den Kanten sollten Lichteffekte entlanglaufen.

    Zitat von Make-Grafik

    Gibts das auch als Bildschirmschoner :D?


    Könnte man leicht draus machen, allerdings sollte man das Script vorher noch etwas optimieren.

    Zitat von Mars

    Auch interessante Funktionen wie AluBrush, CreateAlu und LightBrush sind vorhanden.


    Wie man Aluminium erstellt, hab ich hier gezeigt: GDIPlus gebürstetes Aluminium ;)
    Mit der Funktion _CreateAlu_Brush kann man aus diesem Bitmap einen Brush in jedem beliebigen Farbton erstellen.

    Ganz interessant sind auch die einzelnen Bilder, aus denen das fertige Bild entsteht - einfach von den Zeilen 76, 135 u 144 jeweils zwei auskommentieren.

    E

  • GDI+ AutoIt Logo

    • eukalyptus
    • 2. Mai 2013 um 21:58

    Hi

    Eigentlich wollte ich einen ganz anderen Effekt ausprobieren, hat jedoch leider nicht geklappt...
    Dennoch ist das entstandene Script ganz hübsch anzusehen, denke ich :D
    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Viel Spaß beim ausprobieren!

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <GDIPlusConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WinAPI.au3>
    #include <WindowsConstants.au3>

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

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

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

    _GDIPlus_Startup()

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

    Global $aAutoIt = _CreateAutoItLogo()
    Global $aAutoIt_Dim = _CalcLogoDim($aAutoIt)

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

    Global $iWidth = $aAutoIt_Dim[8] * 2 + 20
    Global $iHeight = $aAutoIt_Dim[9] * 2 + 20

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

    Global $hGui = GUICreate("AutoIt GDI+", $iWidth, $iHeight)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    Global $hDC = _WinAPI_GetDC($hGui)
    Global $hBMP = _WinAPI_CreateCompatibleBitmap($hDC, $iWidth, $iHeight)
    Global $hBmpTmp = _GDIPlus_BitmapCreateFromHBITMAP($hBMP)
    _WinAPI_DeleteObject($hBMP)
    $hBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmpTmp)
    _GDIPlus_BitmapDispose($hBmpTmp)
    Global $hCDC = _WinAPI_CreateCompatibleDC($hDC)
    Global $hOBJ = _WinAPI_SelectObject($hCDC, $hBMP)
    Global $hGfxBuffer = _GDIPlus_GraphicsCreateFromHDC($hCDC)
    _GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer, 2)
    _GDIPlus_GraphicsClear($hGfxBuffer, 0xFF000000)

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

    GUIRegisterMsg($WM_PAINT, "_WM_PAINT")
    GUISetState()

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

    Global $hBmp_Glow
    Global $hBmp_Alu = _CreateAlu($aAutoIt_Dim[2] + 11, $aAutoIt_Dim[3] + 11)
    Global $hBmp_AutoIt = _CreateAutoItBitmap($aAutoIt, $aAutoIt_Dim, $hBmp_Alu)
    Global $aInfo = _CreateInfoBitmap()

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

    Global $hBrush_Light = _CreateLight_Brush($aAutoIt_Dim[2] / 2, 0xBBFFFFFF, 1.2)

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

    While Sleep(10)
    _Draw()
    WEnd

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

    Func _Draw()
    Local Static $fRotate = -30, $fRotateI = 0.33, $fGlow = 0, $fLight = 0
    $fRotate += $fRotateI
    $fGlow += 0.1
    $fLight += 0.011

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

    Local $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, -($aAutoIt_Dim[4] + $aAutoIt_Dim[6] / 2), -($aAutoIt_Dim[5] + $aAutoIt_Dim[7] / 2), True)
    _GDIPlus_MatrixRotate($hMatrix, $fRotate, True)
    _GDIPlus_MatrixTranslate($hMatrix, ($aAutoIt_Dim[8]), ($aAutoIt_Dim[9]), True)

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

    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $aAutoIt_Dim[8] * 2, "int", $aAutoIt_Dim[9] * 2, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    If @error Then Return SetError(1, 3, False)
    Local $hBMP = $aResult[6]
    Local $hGfx = _GDIPlus_ImageGetGraphicsContext($hBMP)
    _GDIPlus_GraphicsSetSmoothingMode($hGfx, 2)
    _GDIPlus_GraphicsSetTransform($hGfx, $hMatrix)

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

    _GDIPlus_GraphicsDrawImage($hGfx, $hBmp_AutoIt, 0, 0)
    _GDIPlus_GraphicsDispose($hGfx)

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

    _GDIPlus_GraphicsClear($hGfxBuffer, 0xFF000000)
    _GDIPlus_GraphicsDrawImage($hGfxBuffer, $hBMP, 0, 0)
    _GDIPlus_BitmapDispose($hBMP)

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

    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    If @error Then Return SetError(1, 3, False)
    Local $hBMP = $aResult[6]
    Local $hGfx = _GDIPlus_ImageGetGraphicsContext($hBMP)
    _GDIPlus_GraphicsSetSmoothingMode($hGfx, 2)

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

    Global $fScale = 1.007

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

    DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "hwnd", $hGfx, "int", 0)
    DllCall($ghGDIPDll, "uint", "GdipTranslateWorldTransform", "hwnd", $hGfx, "float", -$aAutoIt_Dim[8], "float", -$aAutoIt_Dim[9], "int", 1)
    DllCall($ghGDIPDll, "uint", "GdipRotateWorldTransform", "hwnd", $hGfx, "float", $fRotateI + Sin($fGlow) * 0.14, "int", 1)
    DllCall($ghGDIPDll, "uint", "GdipScaleWorldTransform", "hwnd", $hGfx, "float", $fScale, "float", $fScale, "int", 1)
    DllCall($ghGDIPDll, "uint", "GdipTranslateWorldTransform", "hwnd", $hGfx, "float", $aAutoIt_Dim[8], "float", $aAutoIt_Dim[9], "int", 1)

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

    Local $tColorMatrix = DllStructCreate("float[5]; float[5]; float[5]; float[5]; float[5];")
    DllStructSetData($tColorMatrix, 1, 1, 1)
    DllStructSetData($tColorMatrix, 2, 1, 2)
    DllStructSetData($tColorMatrix, 3, 1, 3)
    DllStructSetData($tColorMatrix, 4, 0.96, 4)
    DllStructSetData($tColorMatrix, 5, 1, 5)

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

    Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateImageAttributes", "ptr*", 0)
    If @error Then Return SetError(1, 4, False)
    Local $hImgAttrib = $aResult[1]
    DllCall($ghGDIPDll, "int", "GdipSetImageAttributesColorMatrix", "ptr", $hImgAttrib, "int", 1, "int", 1, "ptr", DllStructGetPtr($tColorMatrix), "ptr", 0, "int", 0)

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

    DllCall($ghGDIPDll, "int", "GdipDrawImageRectRectI", "hwnd", $hGfx, "hwnd", $hBmp_Glow, "int", 0, "int", 0, "int", $iWidth, "int", $iHeight, "int", 0, "int", 0, "int", $iWidth, "int", $iHeight, "int", 2, "ptr", $hImgAttrib, "int", 0, "int", 0)

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

    DllCall($ghGDIPDll, "int", "GdipDisposeImageAttributes", "ptr", $hImgAttrib)

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

    Local $iInfW = _GDIPlus_ImageGetWidth($aInfo[0])
    Local $iInfH = _GDIPlus_ImageGetHeight($aInfo[0])
    _GDIPlus_GraphicsDrawImage($hGfxBuffer, $aInfo[0], $iWidth / 2 - $iInfW / 2, $iHeight - $iInfH - 30)

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

    Local $hClone
    If Random(0, 300, 1) = 0 Then
    $aResult = DllCall($ghGDIPDll, "uint", "GdipClonePath", "hwnd", $aAutoIt[2], "hwnd*", 0)
    $hClone = $aResult[2]
    DllCall($ghGDIPDll, "uint", "GdipTransformPath", "hwnd", $hClone, "hwnd", $hMatrix)
    Local $hPen = _GDIPlus_PenCreate(0xAA000000, 8)
    DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGfx, "hwnd", $hPen, "hwnd", $hClone)
    _GDIPlus_PenDispose($hPen)
    DllCall($ghGDIPDll, "uint", "GdipDeletePath", "hwnd", $hClone)
    EndIf

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipClonePath", "hwnd", $aAutoIt[1], "hwnd*", 0)
    $hClone = $aResult[2]
    DllCall($ghGDIPDll, "uint", "GdipTransformPath", "hwnd", $hClone, "hwnd", $hMatrix)

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

    Local $hPen_Glow = _GDIPlus_PenCreate(0x30FFEEFF, 3)
    DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGfx, "hwnd", $hPen_Glow, "hwnd", $hClone)
    _GDIPlus_PenDispose($hPen_Glow)

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

    _GDIPlus_GraphicsDispose($hGfx)

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

    _GDIPlus_GraphicsDrawImage($hGfxBuffer, $hBMP, 0, 0)
    _GDIPlus_BitmapDispose($hBmp_Glow)
    $hBmp_Glow = $hBMP

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

    DllCall($ghGDIPDll, "uint", "GdipResetLineTransform", "hwnd", $hBrush_Light)
    DllCall($ghGDIPDll, "uint", "GdipRotateLineTransform", "hwnd", $hBrush_Light, "float", 80, "int", 1)
    DllCall($ghGDIPDll, "uint", "GdipScaleLineTransform", "hwnd", $hBrush_Light, "float", 1 + Sin($fLight) * 0.2, "float", 1 + Sin($fLight) * 0.2, "int", 1)

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

    DllCall($ghGDIPDll, "uint", "GdipFillPath", "hwnd", $hGfxBuffer, "hwnd", $hBrush_Light, "hwnd", $hClone)
    DllCall($ghGDIPDll, "uint", "GdipDeletePath", "hwnd", $hClone)

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

    DllCall($ghGDIPDll, "uint", "GdipFillPath", "hwnd", $hGfxBuffer, "hwnd", $hBrush_Light, "hwnd", $aInfo[1])

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

    _GDIPlus_MatrixDispose($hMatrix)

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

    _WinAPI_BitBlt($hDC, 0, 0, $iWidth, $iHeight, $hCDC, 0, 0, 0x00CC0020)
    EndFunc ;==>_Draw

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

    Func _CreateAutoItBitmap($aAutoIt, $aAutoIt_Dim, $hBmp_Alu)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $aAutoIt_Dim[2] + 20, "int", $aAutoIt_Dim[3] + 20, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    If @error Then Return SetError(1, 3, False)
    Local $hBMP = $aResult[6]
    Local $hGfx = _GDIPlus_ImageGetGraphicsContext($hBMP)
    _GDIPlus_GraphicsSetSmoothingMode($hGfx, 2)

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

    Local $hBrush_Alu_1 = _CreateAlu_Brush($hBmp_Alu, 0.75, 0.8, 0.75)
    Local $hBrush_Alu_2 = _CreateAlu_Brush($hBmp_Alu, 0.1, 0.3, 0.8)
    Local $hBrush_Alu_3 = _CreateAlu_Brush($hBmp_Alu, 0.64, 0.1, 0.1)

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

    DllCall($ghGDIPDll, "uint", "GdipFillPath", "hwnd", $hGfx, "hwnd", $hBrush_Alu_1, "hwnd", $aAutoIt[1])
    DllCall($ghGDIPDll, "uint", "GdipFillPath", "hwnd", $hGfx, "hwnd", $hBrush_Alu_2, "hwnd", $aAutoIt[4])
    DllCall($ghGDIPDll, "uint", "GdipFillPath", "hwnd", $hGfx, "hwnd", $hBrush_Alu_3, "hwnd", $aAutoIt[5])
    _GDIPlus_BrushDispose($hBrush_Alu_1)
    _GDIPlus_BrushDispose($hBrush_Alu_2)
    _GDIPlus_BrushDispose($hBrush_Alu_3)

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

    Local $aGlowColor[6] = [0, 0, 0x00EEFFEE, 0x00DDFFDD, 0x006688FF, 0x00FF6666]
    Local $aGlowSize[6] = [0, 0, 16, 14, 14, 10]

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

    Local $hPen_Glow = _GDIPlus_PenCreate()
    DllCall($ghGDIPDll, "uint", "GdipSetPenLineJoin", "hwnd", $hPen_Glow, "int", 1)

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

    For $i = 2 To $aAutoIt[0]
    _GDIPlus_PenSetColor($hPen_Glow, BitOR(0x14000000, $aGlowColor[$i]))

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

    For $j = 1 To $aGlowSize[$i] Step 2
    _GDIPlus_PenSetWidth($hPen_Glow, $aGlowSize[$i] + 3 - $j)
    DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGfx, "hwnd", $hPen_Glow, "hwnd", $aAutoIt[$i])
    Next

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

    _GDIPlus_PenSetWidth($hPen_Glow, 2)
    _GDIPlus_PenSetColor($hPen_Glow, BitOR(0xDD000000, $aGlowColor[$i]))
    DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGfx, "hwnd", $hPen_Glow, "hwnd", $aAutoIt[$i])
    Next

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

    _GDIPlus_PenDispose($hPen_Glow)

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

    _GDIPlus_GraphicsDispose($hGfx)

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

    Return $hBMP
    EndFunc ;==>_CreateAutoItBitmap

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

    Func _CreateInfoBitmap()
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePath", "int", 0, "int*", 0)
    If @error Then Return SetError(1, 1, False)
    Local $hPath = $aResult[2]

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

    DllCall($ghGDIPDll, "uint", "GdipAddPathString", "hwnd", $hPath, "wstr", "AutoIt GDI+ Script by Eukalyptus", "int", -1, "hwnd", $hFamily, "int", 0, "float", 13, "ptr", DllStructGetPtr($tLayout), "hwnd", $hFormat)

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

    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)

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

    Local $tBounds = _GDIPlus_RectFCreate(0, 0, 0, 0)
    DllCall($ghGDIPDll, "uint", "GdipGetPathWorldBounds", "hwnd", $hPath, "ptr", DllStructGetPtr($tBounds), "hwnd", 0, "hwnd", 0)

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

    Local $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, -DllStructGetData($tBounds, "X") + 10, -DllStructGetData($tBounds, "Y") + 10, 0)
    DllCall($ghGDIPDll, "uint", "GdipTransformPath", "hwnd", $hPath, "hwnd", $hMatrix)
    _GDIPlus_MatrixDispose($hMatrix)

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

    Local $iImgW = DllStructGetData($tBounds, "Width") + 20
    Local $iImgH = DllStructGetData($tBounds, "Height") + 20
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iImgW, "int", $iImgH, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    If @error Then Return SetError(1, 3, False)
    Local $hBMP = $aResult[6]
    Local $hGfx = _GDIPlus_ImageGetGraphicsContext($hBMP)
    _GDIPlus_GraphicsSetSmoothingMode($hGfx, 2)

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

    Local $hPen = _GDIPlus_PenCreate(0x0444FFAA)
    DllCall($ghGDIPDll, "uint", "GdipSetPenLineJoin", "hwnd", $hPen, "int", 1)
    For $i = 12 To 1 Step -1
    _GDIPlus_PenSetWidth($hPen, $i)
    DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGfx, "hwnd", $hPen, "hwnd", $hPath)
    Next
    _GDIPlus_PenSetWidth($hPen, 1)
    _GDIPlus_PenSetColor($hPen, 0xFF88DD88)
    DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGfx, "hwnd", $hPen, "hwnd", $hPath)

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

    Local $hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    DllCall($ghGDIPDll, "uint", "GdipFillPath", "hwnd", $hGfx, "hwnd", $hBrush, "hwnd", $hPath)
    _GDIPlus_BrushDispose($hBrush)

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

    _GDIPlus_PenSetWidth($hPen, 2)
    DllCall($ghGDIPDll, "uint", "GdipWidenPath", "hwnd", $hPath, "hwnd", $hPen, "hwnd", 0, "float", 0.1)
    _GDIPlus_PenDispose($hPen)

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

    _GDIPlus_GraphicsDispose($hGfx)

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

    Local $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, $iWidth / 2 - $iImgW / 2, $iHeight - $iImgH - 30, 0)
    DllCall($ghGDIPDll, "uint", "GdipTransformPath", "hwnd", $hPath, "hwnd", $hMatrix)
    _GDIPlus_MatrixDispose($hMatrix)

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

    Local $aReturn[2]
    $aReturn[0] = $hBMP
    $aReturn[1] = $hPath
    Return $aReturn
    EndFunc ;==>_CreateInfoBitmap

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

    Func _CreateLight_Brush($fSize, $iLightColor = 0xAAFFFFFF, $fLightScale = 1.3)
    Local $tPointF1 = DllStructCreate("float; float;")
    Local $tPointF2 = DllStructCreate("float; float;")
    DllStructSetData($tPointF2, 2, $fSize * $fLightScale)

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

    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateLineBrush", "ptr", DllStructGetPtr($tPointF1), "ptr", DllStructGetPtr($tPointF2), "uint", 0, "uint", $iLightColor, "int", 0, "int*", 0)
    If @error Or Not IsArray($aResult) Then Return SetError(1, 4, False)
    Local $hBrush = $aResult[6]

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

    DllCall($ghGDIPDll, "uint", "GdipSetLineSigmaBlend", "hwnd", $hBrush, "float", 0.5, "float", 1)
    DllCall($ghGDIPDll, "uint", "GdipSetLineGammaCorrection", "hwnd", $hBrush, "int", True)

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

    Return $hBrush
    EndFunc ;==>_CreateLight_Brush

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

    Func _CreateAlu_Brush($hBmp_Alu, $fRed = 1, $fGreen = 1, $fBlue = 1)
    Local $iImgW = _GDIPlus_ImageGetWidth($hBmp_Alu)
    Local $iImgH = _GDIPlus_ImageGetHeight($hBmp_Alu)

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

    Local $tColorMatrix = DllStructCreate("float[5]; float[5]; float[5]; float[5]; float[5];")
    DllStructSetData($tColorMatrix, 1, $fRed, 1)
    DllStructSetData($tColorMatrix, 2, $fGreen, 2)
    DllStructSetData($tColorMatrix, 3, $fBlue, 3)
    DllStructSetData($tColorMatrix, 4, 1, 4)
    DllStructSetData($tColorMatrix, 5, 1, 5)

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

    Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateImageAttributes", "ptr*", 0)
    If @error Then Return SetError(1, 4, False)
    Local $hImgAttrib = $aResult[1]
    DllCall($ghGDIPDll, "int", "GdipSetImageAttributesColorMatrix", "ptr", $hImgAttrib, "int", 1, "int", 1, "ptr", DllStructGetPtr($tColorMatrix), "ptr", 0, "int", 0)

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

    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateTextureIA", "hwnd", $hBmp_Alu, "hwnd", $hImgAttrib, "float", 0, "float", 0, "float", $iImgW, "float", $iImgH, "int*", 0)
    If @error Then Return SetError(1, 1, False)
    Local $hBrush = $aResult[7]

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

    DllCall($ghGDIPDll, "int", "GdipDisposeImageAttributes", "ptr", $hImgAttrib)

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

    Return $hBrush
    EndFunc ;==>_CreateAlu_Brush

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

    Func _CalcLogoDim($aAutoIt)
    Local $aDim[10]
    Local $tBounds = _GDIPlus_RectFCreate(0, 0, 0, 0)
    Local $pBounds = DllStructGetPtr($tBounds)

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

    DllCall($ghGDIPDll, "uint", "GdipGetPathWorldBounds", "hwnd", $aAutoIt[1], "ptr", $pBounds, "hwnd", 0, "hwnd", 0)
    $aDim[0] = DllStructGetData($tBounds, "X")
    $aDim[1] = DllStructGetData($tBounds, "Y")
    $aDim[2] = DllStructGetData($tBounds, "Width")
    $aDim[3] = DllStructGetData($tBounds, "Height")

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

    DllCall($ghGDIPDll, "uint", "GdipGetPathWorldBounds", "hwnd", $aAutoIt[3], "ptr", $pBounds, "hwnd", 0, "hwnd", 0)
    $aDim[4] = DllStructGetData($tBounds, "X")
    $aDim[5] = DllStructGetData($tBounds, "Y")
    $aDim[6] = DllStructGetData($tBounds, "Width")
    $aDim[7] = DllStructGetData($tBounds, "Height")

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

    $aDim[8] = ($aDim[2] - $aDim[6] / 2) + $aDim[4]
    $aDim[9] = ($aDim[3] - $aDim[7] / 2) + $aDim[4]

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

    Return $aDim
    EndFunc ;==>_CalcLogoDim

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

    Func _CreateAutoItLogo()
    Local $bLogo = "0x6A0000006E2D404317F67B4108CA624333A77B410C9E8143C649C7417BA08F4303B02342CA4C9343F3C38B41A23F9E43D31AF13ECB2CAB43D31AF13E8523BB43D31AF13EAF10C8430797D241AF10C84353016942AF10C843A57DA8429A78BF433E79D442C4ACB34341FAE242F07DBB43B7450D432FF7BF43474B2D432FF7BF43556F4F432FF7BF43C8AB9C43D50A95432198C7436E2D40432198C74381A2AC422198C743D31AF13EC8AB9C43D31AF13E556F4F43D31AF13E4D26CB4281A2AC4233A77B416E2D404333A77B416E2D4043FCD2B343BDE18943AF9AB343BBF9AB43B0829143BBF9AB43556F4F43BBF9AB438FB2F742BDE1894364D55E426E2D404364D55E42C32ED94264D55E42CDCD21428FB2F742CDCD2142556F4F43CDCD2142B0829143C32ED942AF9AB3436E2D4043AF9AB34319730E43D4E5834317D2174326C27A43163121433C0B6E4305842A43444861437FDA36434448614348BD5E439AB76043A5FB6A43D1C06143C4DB6043AFD95443C1D44943F824324326CA404380F52443883E294302C84543F7BE114390A66643CE7EF44288BC8343D4DBCF4288BC8343BD20AB4288BC8343C37D864288BC83431CB9C64296BC5A433B7A03430DF42D43E797234393370143BCA633433B2BD64246634F4392C1D442F24D5F4393370143AF9E7E430DF42D43AEF18E4396BC5A430B9A9E4388BC8343E179814388BC83436EB3484388BC834319730E4388BC8343E52DA043B9B0374279C8A543367737420B63AB43367737429EFDB04336773742582BB443367737427543B443D2B450429EFDB043D2B45042DF17AC43D2B45042192CA743D2B450425B46A243D2B45042E091A3434AE45D426CE3A443C2136B42F834A64300137842A57DA843001378420858B14321A075427E97B24318B67A427D70B3434B4A7E4212EFB343C12F8842C11BB143C12F8842B741AA43C12F8842AD67A343C12F88429E879C43C12F88428C2D9E430719904274CD9F436C1A98425C6DA143D01BA042F255A543D01BA0425DA0B143233DA14209C2B443EF819E42E750BC4317D29742139CBB43D0CC7242C516B743ACBE6642990EBC43DBD15B42BB05BD43BBC61B4241CBB5439D540C423055B243FFFB0442D01BA043C12F084234549B43C12F08421DF49C434F021842FE8D9E43DFD42742E52DA04336773742000303030303030303030303030303030303030303030303830003030303030303030303038300030303030303030303030303030303030303030303030303030383000303030303030303030303030303030303030303030303030303030303030303030303030303830000"

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

    Local $tLogo = DllStructCreate("byte[" & BinaryLen($bLogo) & "];")
    DllStructSetData($tLogo, 1, $bLogo)
    Local $tCnt = DllStructCreate("uint", DllStructGetPtr($tLogo))
    Local $iPathCnt = DllStructGetData($tCnt, 1)
    Local $tPathData = DllStructCreate("uint Cnt; float Pnt[" & $iPathCnt * 2 & "]; ubyte Type[" & $iPathCnt & "];", DllStructGetPtr($tLogo))

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

    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePath2", "ptr", DllStructGetPtr($tPathData, "Pnt"), "ptr", DllStructGetPtr($tPathData, "Type"), "int", $iPathCnt, "int", 0, "int*", 0)
    If @error Then Return SetError(1, 1, False)
    Local $hPath = $aResult[5]

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

    Local $tBounds = _GDIPlus_RectFCreate(0, 0, 0, 0)
    Local $pBounds = DllStructGetPtr($tBounds)

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

    DllCall($ghGDIPDll, "uint", "GdipGetPathWorldBounds", "hwnd", $hPath, "ptr", $pBounds, "hwnd", 0, "hwnd", 0)
    Local $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, -DllStructGetData($tBounds, "X") + 10, -DllStructGetData($tBounds, "Y") + 10, 0)
    DllCall($ghGDIPDll, "uint", "GdipTransformPath", "hwnd", $hPath, "hwnd", $hMatrix)
    _GDIPlus_MatrixDispose($hMatrix)

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePathIter", "int*", 0, "hwnd", $hPath)
    If @error Then Return SetError(1, 2, False)
    Local $hPathIter = $aResult[1]

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipPathIterGetSubpathCount", "hwnd", $hPathIter, "int*", 0)
    If @error Then Return SetError(1, 3, False)
    Local $iPathIter = $aResult[2]

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

    Local $aReturn[$iPathIter + 2] = [$iPathIter + 1]
    For $i = 1 To $iPathIter
    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePath", "int", 0, "int*", 0)
    If @error Then Return SetError(1, 4, False)
    $aReturn[$i + 1] = $aResult[2]
    DllCall($ghGDIPDll, "uint", "GdipPathIterNextSubpathPath", "hwnd", $hPathIter, "int*", 0, "hwnd", $aReturn[$i + 1], "int*", 0)
    Next
    DllCall($ghGDIPDll, "uint", "GdipDeletePathIter", "hwnd", $hPathIter)

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

    $aReturn[1] = $hPath

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

    Return $aReturn
    EndFunc ;==>_CreateAutoItLogo

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

    Func _CreateAlu($iW, $iH, $iBlurDist = 14, $fBlurTrans = 0.6)
    $iBlurDist = Ceiling($iBlurDist)
    $iBlurDist += 1 - Mod($iBlurDist, 2)

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

    Local $iOverSize = 0
    For $i = 1 To $iBlurDist Step 2
    $iOverSize += $i + $i + 1
    Next

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

    Local $iWO = $iW + $iOverSize

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

    Local $iNoiseSize = 40

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

    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iNoiseSize, "int", $iNoiseSize, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    If @error Or Not IsArray($aResult) Then Return SetError(1, 1, False)
    Local $hBmp_Noise = $aResult[6]
    Local $hGfx_Noise = _GDIPlus_ImageGetGraphicsContext($hBmp_Noise)

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

    Local $tData = _GDIPlus_BitmapLockBits($hBmp_Noise, 0, 0, $iNoiseSize, $iNoiseSize, BitOR($GDIP_ILMREAD, $GDIP_ILMWRITE), $GDIP_PXF32ARGB)
    Local $iStride = DllStructGetData($tData, "Stride")
    Local $iWidth = DllStructGetData($tData, "Width")
    Local $iHeight = DllStructGetData($tData, "Height")
    Local $pScan0 = DllStructGetData($tData, "Scan0")
    Local $tPixel = DllStructCreate("dword[" & $iWidth * $iHeight & "];", $pScan0)

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

    Local $iAmp
    For $row = 0 To $iHeight - 1
    For $col = 0 To $iWidth - 1
    $iAmp = Random(0, 0xFF, 1)
    DllStructSetData($tPixel, 1, BitOR(0xFF000000, BitShift($iAmp, -16), BitShift($iAmp, -8), $iAmp), $row * $iWidth + $col + 1)
    Next
    Next

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

    _GDIPlus_BitmapUnlockBits($hBmp_Noise, $tData)

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWO, "int", $iH, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    If @error Or Not IsArray($aResult) Then Return SetError(1, 3, False)
    Local $hBmp_Full = $aResult[6]
    Local $hGfx_Full = _GDIPlus_ImageGetGraphicsContext($hBmp_Full)
    _GDIPlus_GraphicsSetSmoothingMode($hGfx_Full, 2)
    DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "hwnd", $hGfx_Full, "int", 7)

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

    Local $iXOff, $iYOff, $iSizeX, $iSizeY
    For $y = 0 To $iH Step $iNoiseSize / 2
    For $x = 0 To $iWO Step $iNoiseSize / 2
    $iXOff = Random(0, $iNoiseSize / 2, 1)
    $iYOff = Random(0, $iNoiseSize / 2, 1)
    $iSizeX = $iNoiseSize - $iXOff
    $iSizeY = $iNoiseSize - $iYOff
    _GDIPlus_GraphicsDrawImageRectRect($hGfx_Full, $hBmp_Noise, $iXOff, $iYOff, $iSizeX, $iSizeY, $x, $y, $iSizeX, $iSizeY)
    Next
    Next

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

    _GDIPlus_GraphicsDispose($hGfx_Noise)
    _GDIPlus_BitmapDispose($hBmp_Noise)

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWO, "int", $iH, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    If @error Or Not IsArray($aResult) Then Return SetError(1, 3, False)
    Local $hBmp_Full2 = $aResult[6]
    Local $hGfx_Full2 = _GDIPlus_ImageGetGraphicsContext($hBmp_Full2)
    _GDIPlus_GraphicsSetSmoothingMode($hGfx_Full2, 2)
    DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "hwnd", $hGfx_Full2, "int", 7)

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

    Local $tColorMatrix = DllStructCreate("float[5]; float[5]; float[5]; float[5]; float[5];")
    DllStructSetData($tColorMatrix, 1, 1, 1)
    DllStructSetData($tColorMatrix, 2, 1, 2)
    DllStructSetData($tColorMatrix, 3, 1, 3)
    DllStructSetData($tColorMatrix, 4, $fBlurTrans, 4)
    DllStructSetData($tColorMatrix, 5, 1, 5)

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

    $aResult = DllCall($ghGDIPDll, "int", "GdipCreateImageAttributes", "ptr*", 0)
    If @error Or Not IsArray($aResult) Then Return SetError(1, 4, False)
    Local $hImgAttrib = $aResult[1]
    DllCall($ghGDIPDll, "int", "GdipSetImageAttributesColorMatrix", "ptr", $hImgAttrib, "int", 1, "int", 1, "ptr", DllStructGetPtr($tColorMatrix), "ptr", 0, "int", 0)

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

    For $i = 1 To $iBlurDist Step 2
    DllCall($ghGDIPDll, "int", "GdipDrawImageRectRectI", "hwnd", $hGfx_Full2, "hwnd", $hBmp_Full, "int", $i, "int", 0, "int", $iWO, "int", $iH, "int", 0, "int", 0, "int", $iWO, "int", $iH, "int", 2, "ptr", $hImgAttrib, "int", 0, "int", 0)
    DllCall($ghGDIPDll, "int", "GdipDrawImageRectRectI", "hwnd", $hGfx_Full, "hwnd", $hBmp_Full2, "int", $i + 1, "int", 0, "int", $iWO, "int", $iH, "int", 0, "int", 0, "int", $iWO, "int", $iH, "int", 2, "ptr", $hImgAttrib, "int", 0, "int", 0)
    Next
    DllCall($ghGDIPDll, "int", "GdipDisposeImageAttributes", "ptr", $hImgAttrib)

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

    _GDIPlus_GraphicsDispose($hGfx_Full2)
    _GDIPlus_BitmapDispose($hBmp_Full2)
    _GDIPlus_GraphicsDispose($hGfx_Full)

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iW, "int", $iH, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    If @error Or Not IsArray($aResult) Then Return SetError(1, 3, False)
    Local $hBmp_Alu = $aResult[6]
    Local $hGfx_Alu = _GDIPlus_ImageGetGraphicsContext($hBmp_Alu)
    _GDIPlus_GraphicsSetSmoothingMode($hGfx_Alu, 2)
    DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "hwnd", $hGfx_Alu, "int", 7)

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

    _GDIPlus_GraphicsDrawImage($hGfx_Alu, $hBmp_Full, -$iOverSize, 0)
    _GDIPlus_BitmapDispose($hBmp_Full)
    _GDIPlus_GraphicsDispose($hGfx_Alu)

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

    Return $hBmp_Alu
    EndFunc ;==>_CreateAlu

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

    Func _WM_PAINT($hWnd, $iMsg, $wParam, $lParam)
    _WinAPI_BitBlt($hDC, 0, 0, $iWidth, $iHeight, $hCDC, 0, 0, 0x00CC0020)
    Return $GUI_RUNDEFMSG
    EndFunc ;==>_WM_PAINT

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

    Func _Exit()
    For $i = 1 To $aAutoIt[0]
    DllCall($ghGDIPDll, "uint", "GdipDeletePath", "hwnd", $aAutoIt[$i])
    Next
    DllCall($ghGDIPDll, "uint", "GdipDeletePath", "hwnd", $aInfo[1])

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

    _GDIPlus_BitmapDispose($hBmp_Alu)
    _GDIPlus_BitmapDispose($hBmp_AutoIt)
    _GDIPlus_BitmapDispose($hBmp_Glow)
    _GDIPlus_BitmapDispose($aInfo[0])

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

    _GDIPlus_BrushDispose($hBrush_Light)

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

    _GDIPlus_GraphicsDispose($hGfxBuffer)
    _WinAPI_SelectObject($hCDC, $hOBJ)
    _WinAPI_DeleteObject($hBMP)
    _WinAPI_DeleteDC($hCDC)
    _WinAPI_ReleaseDC($hGui, $hDC)
    _GDIPlus_Shutdown()
    GUIDelete($hGui)
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    E

    Dateien

    AutoIt.JPG 25,69 kB – 0 Downloads
  • PathWarp To Path bzw. Text zu Bezierkurve biegen

    • eukalyptus
    • 1. Mai 2013 um 22:25

    Erstmal Danke für die Lorbeeren!

    Zitat von Andy

    Auch die AutoIt-Structs, aus denen du Daten liest/schreibst gehören 16-Byte-aligned!


    Mit dem Alignen hatte ich in der Vergangenheit immer wieder mal Probleme.
    Und zwar funktioniert der Code problemlos, solange der ASM-Code "live" kompiliert wird.
    Sobald man aber den kompilierten ByteCode benutzt, stürzt das Script plötzlich hin und wieder ab.
    Da ich dieses Problem bisher nicht lösen konnte, verwende ich immer movdqu, auch wenn es langsamer ist.
    Und das betrifft leider auch die Speicherstelle im Stack!

    Zuerst dachte ich, dass ich nur den "CodeBuffer" alignen müsste, aber auch das hat nicht geholfen...


    Zitat von Andy

    Wenn du die Möglichkeit hast, dann bau die Struct direkt so, dass du immer 16-Byte Blöcke holen kannst


    Der Aufbau hängt in diesem Fall von GDIPlus ab; ich lese und schreibe eben in dem Format, damit ich die Daten dann direkt an GDIPlus weitergeben kann.

    Im Großen und Ganzen bin ich ja mit meiner Leistung zufrieden.
    Ich benötige ja derzeit schon 130% meiner Gehirnleistung um überhaupt die Werte der einzelnen Register im Auge zu behalten. ^^
    Für weitere Optimierungsschritte hab ich z.Z leider keinen Slot mehr frei :D


    E

  • PathWarp To Path bzw. Text zu Bezierkurve biegen

    • eukalyptus
    • 1. Mai 2013 um 15:18

    Sehr cooles Script UEZ! :rock:
    Das bringt mich auf eine Idee - gleich mal ausprobieren ;)

    Läuft bei mir übrigens auf WinXP und Win7 ohne Probleme

    Mit reinem AutoIt-Code wird z.B. Example_7 nur alle 4 Sekunden geupdated.
    Evtl. könnte man den Code auf die doppelte Geschwindigkeit optimieren, aber wirklich flüssig gehts nur mit ASM


    Im Anhang der ASM-Code für die Interessierten

    E

    Dateien

    ASM.au3 25,76 kB – 475 Downloads
  • PathWarp To Path bzw. Text zu Bezierkurve biegen

    • eukalyptus
    • 29. April 2013 um 10:54

    Ich hab hier eine UDF für euch, mit der man Text auf eine Kurve projizieren kann.
    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.
    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.
    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Die Idee dazu stammt von hier: http://www.planetclegg.com/projects/WarpingTextToSplines.html

    Im Anhang befindet sich die UDF incl. Beispiele
    Die UDF ist noch Beta, deshalb fehlen noch die Funktionsbeschreibungen; Ich hoffe aber, dass die Beispiele trotzdem zu verstehen sind ;)


    Viel Spaß beim experimentieren...
    Ach ja - läuft nur unter X86.

    E

    Bilder

    • Example_1.JPG
      • 11,19 kB
      • 318 × 367

    Dateien

    PathWarp.7z 4,79 kB – 516 Downloads Example_6.JPG 47,22 kB – 0 Downloads Example_7.JPG 18,53 kB – 0 Downloads

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™