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

Beiträge von Sprenger120

  • [Formel] Etwas fürs Auge

    • Sprenger120
    • 16. März 2011 um 18:07

    Hi Andy,
    geile Idee :thumbup:. Aber wir müssen dann immer für nützlichen Rechennachschub sorgen.

  • [GDI] Eine Pixelfarbe (zB 0xFFFFFF) nicht mit zeichen/ transparent machen

    • Sprenger120
    • 16. März 2011 um 17:57

    Hi,
    ja es kann auch nichts anderes sein weil GUISetBkColor() kein Alpha unterstützt ^^

  • StringRegExp Tutorial / Reguläre Ausdrücke in AutoIt

    • Sprenger120
    • 15. März 2011 um 21:38

    Hi,
    ja dein Post ist irrrelevant ^^. Javascript hat einen eigenen RegEx Dialekt.

  • AutoBot initalisiert...

    • Sprenger120
    • 15. März 2011 um 20:05

    Hi AutoBot,
    herzlich willkommen im Forum :party:

    PS: mach dir nichts draus was die alle Sagen ^^ Solange du keinen mist baust sind das nur spekulationen ;)

  • [Formel] Etwas fürs Auge

    • Sprenger120
    • 15. März 2011 um 20:03

    Hi,
    meins würde auch in diesem schnellen Bereich liegen wenn ich nicht die 2 divisionen drinne hätte. Die fressen insgesamt 140 Takte und das ist zu viel !
    Ich könnte zwar den Code so weit umschreiben das er nur noch ein div bräuchte aber dazu hab ich keine lust ^^, und mal unter uns: wen interressierts ob das rendern nu 100ms oder 500 braucht. Schneller als AutoIt ist es allemal :thumbup:

  • [GDI] Eine Pixelfarbe (zB 0xFFFFFF) nicht mit zeichen/ transparent machen

    • Sprenger120
    • 15. März 2011 um 18:29
    Zitat von DFPWare

    ich bin mir nicht sicher aber ist 0xABCDEF nicht durchsichtig?


    Das ist Hellblau. Durchsichtig ist wenn der Alpha Wert 0 ist also 0x00000000 oder 0x00FFFFFF ganz egal haubtsache Alpha ist 0.

  • Bälle die von Wänden und Gegenständen abprallen

    • Sprenger120
    • 15. März 2011 um 18:11

    Hi UEZ,
    ich hab mich mal etwas damit beschäftigt, hab auch schon was funktionierendes geschrieben nur die Engine ist ziemlich verbuggt und ich habe moritz erstmal eine PM geschrieben.

  • Bälle die von Wänden und Gegenständen abprallen

    • Sprenger120
    • 15. März 2011 um 16:15

    Hi,
    ich habe mal als Grundlage für ein Spiel mal eine kleine Physik Demo gebaut. Nur leider spinnt die Kollisionserkennung manchmal rum (Ball fliegt durch Körper durch).

    viel Spaß damit

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

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <WinAPI.au3>
    #include <WindowsConstants.au3>
    #include <Array.au3>
    HotKeySet("{Esc}", "_Exit")

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

    _GDIPlus_Startup()
    $hGUI = GUICreate("Ball Physik Demo by Sprenger120", 500, 500, 50, 50)
    $hGUIDC = _WinAPI_GetDC($hGUI)
    $hBitmapBackpuffer = _WinAPI_CreateCompatibleBitmap($hGUIDC, 500, 500)
    $hDCBackpuffer = _WinAPI_CreateCompatibleDC($hGUIDC)
    _WinAPI_SelectObject($hDCBackpuffer, $hBitmapBackpuffer)
    $hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDCBackpuffer)
    GUISetState(@SW_SHOW)

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

    Global Const $iBall = 5;Größe des Balles
    Global Const $iPunkteAnz = 7 ;Anzahl der Punkte
    Global Const $iRectAnz = 5;Anzahl der Quadrate

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

    Global Const $ARRAY_X = 0
    Global Const $ARRAY_Y = 1
    Global Const $ARRAY_StepX = 2
    Global Const $ARRAY_StepY = 3
    Global Const $ARRAY_NextStepColl = 4
    Global Const $ARRAY_Width = 2
    Global Const $ARRAY_Height = 3

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

    Dim $aPunkte[$iPunkteAnz][5] ;X|Y|StepX|StepY|NextStepCollision
    Dim $aRect[$iRectAnz][4] ;X|Y|W|H

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

    ;Punkte Array befüllen

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

    For $x = 0 To $iPunkteAnz - 1
    $aPunkte[$x][$ARRAY_X] = Random(0,500,1)
    $aPunkte[$x][$ARRAY_Y] = Random(0,500,1)
    $aPunkte[$x][$ARRAY_StepX] = 8;Random(5, 10, 1)
    $aPunkte[$x][$ARRAY_StepY] = 8;Random(5, 10, 1)
    If Mod($aPunkte[$x][$ARRAY_StepX], 2) Then $aPunkte[$x][$ARRAY_StepX] += 1
    ;~ If Mod($aPunkte[$x][$ARRAY_StepY], 2) Then $aPunkte[$x][$ARRAY_StepY] += 1
    $aPunkte[$x][$ARRAY_NextStepColl] = 0
    Next

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

    ;Rect Array befüllen
    For $x = 0 To $iRectAnz - 1
    $aRect[$x][0] = Random(100, 400, 1)
    $aRect[$x][1] = Random(100, 400, 1)
    $aRect[$x][2] = Random(20, 90, 1)
    $aRect[$x][3] = Random(20, 90, 1)

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

    While 1

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

    ;Prüfen ob sich Rechtecke nicht berühren
    For $i = 0 To $iRectAnz - 1
    If $i = $x Then ContinueLoop

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

    If _RectCollision($aRect[$x][$ARRAY_X], $aRect[$x][$ARRAY_Y], $aRect[$x][$ARRAY_Width], $aRect[$x][$ARRAY_Width], $aRect[$i][0], $aRect[$i][1], $aRect[$i][2], $aRect[$i][3]) Then
    $aRect[$x][0] = Random(100, 400, 1)
    $aRect[$x][1] = Random(100, 400, 1)
    $aRect[$x][2] = Random(20, 90, 1)
    $aRect[$x][3] = Random(20, 90, 1)
    ContinueLoop 2
    EndIf
    Next
    ExitLoop
    WEnd
    Next

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

    #cs
    $aPunkte[0][$ARRAY_X] = 0
    $aPunkte[0][$ARRAY_Y] = 125
    $aPunkte[0][$ARRAY_StepX] = 10;Random(5, 15, 1)
    $aPunkte[0][$ARRAY_StepY] = 0;Random(5, 15, 1)
    $aPunkte[0][$ARRAY_NextStepColl] = 0

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

    $aPunkte[1][$ARRAY_X] = 125
    $aPunkte[1][$ARRAY_Y] = 0
    $aPunkte[1][$ARRAY_StepX] = 0;Random(5, 15, 1)
    $aPunkte[1][$ARRAY_StepY] = 10;Random(5, 15, 1)
    $aPunkte[1][$ARRAY_NextStepColl] = 0

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

    $aPunkte[2][$ARRAY_X] = 300
    $aPunkte[2][$ARRAY_Y] = 101
    $aPunkte[2][$ARRAY_StepX] = 10;Random(5, 15, 1)
    $aPunkte[2][$ARRAY_StepY] = 0;Random(5, 15, 1)
    $aPunkte[2][$ARRAY_NextStepColl] = 0

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

    $aPunkte[3][$ARRAY_X] = 101
    $aPunkte[3][$ARRAY_Y] = 300
    $aPunkte[3][$ARRAY_StepX] = 0;Random(5, 15, 1)
    $aPunkte[3][$ARRAY_StepY] = 10;Random(5, 15, 1)
    $aPunkte[3][$ARRAY_NextStepColl] = 0

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

    $aRect[0][$ARRAY_X] = 100
    $aRect[0][$ARRAY_Y] = 100
    $aRect[0][$ARRAY_Width] = 50
    $aRect[0][$ARRAY_Height] = 50

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

    $aRect[1][$ARRAY_X] = 150
    $aRect[1][$ARRAY_Y] = 100
    $aRect[1][$ARRAY_Width] = 50
    $aRect[1][$ARRAY_Height] = 50
    $aRect[2][$ARRAY_X] = 200
    $aRect[2][$ARRAY_Y] = 100
    $aRect[2][$ARRAY_Width] = 50
    $aRect[2][$ARRAY_Height] = 50
    $aRect[3][$ARRAY_X] = 125
    $aRect[3][$ARRAY_Y] = 150
    $aRect[3][$ARRAY_Width] = 50
    $aRect[3][$ARRAY_Height] = 50
    $aRect[4][$ARRAY_X] = 175
    $aRect[4][$ARRAY_Y] = 150
    $aRect[4][$ARRAY_Width] = 50
    $aRect[4][$ARRAY_Height] = 50
    #ce

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

    $hBrushPunkte = _GDIPlus_BrushCreateSolid(0xFF22b14c)
    While Sleep(20)
    _GDIPlus_GraphicsClear($hGraphics, 0xFFFFFFFF)

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

    ;Punkte Zeichnen
    For $x = 0 To $iPunkteAnz - 1
    _GDIPlus_GraphicsFillRect($hGraphics, $aPunkte[$x][$ARRAY_X] + $iBall / 2, $aPunkte[$x][$ARRAY_Y] + $iBall / 2, $iBall, $iBall, $hBrushPunkte)
    Next

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

    ;Rect's zeichnen
    For $x = 0 To $iRectAnz - 1
    _GDIPlus_GraphicsDrawRect($hGraphics, $aRect[$x][0], $aRect[$x][1], $aRect[$x][2], $aRect[$x][3])
    Next

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

    For $x = 0 To $iPunkteAnz - 1
    ;Seitenwände
    If $aPunkte[$x][$ARRAY_X] > 500 Then $aPunkte[$x][$ARRAY_StepX] *= -1 ;Rechts
    If $aPunkte[$x][$ARRAY_Y] > 500 Then $aPunkte[$x][$ARRAY_StepY] *= -1 ;Unten
    If $aPunkte[$x][$ARRAY_X] < 0 Then $aPunkte[$x][$ARRAY_StepX] *= -1 ;Links
    If $aPunkte[$x][$ARRAY_Y] < 0 Then $aPunkte[$x][$ARRAY_StepY] *= -1 ;Oben

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

    Switch $aPunkte[$x][$ARRAY_NextStepColl]
    Case True
    Switch $aPunkte[$x][$ARRAY_NextStepColl]
    Case 1 ;oben, unten
    $aPunkte[$x][$ARRAY_StepY] *= -1
    Case 2 ;rechts, links
    $aPunkte[$x][$ARRAY_StepX] *= -1
    Case 3 ;beide Achsen umkehren
    $aPunkte[$x][$ARRAY_StepX] *= -1
    $aPunkte[$x][$ARRAY_StepY] *= -1
    EndSwitch
    $aPunkte[$x][$ARRAY_NextStepColl] = 0
    $aPunkte[$x][$ARRAY_StepX] = Int($aPunkte[$x][$ARRAY_StepX])
    $aPunkte[$x][$ARRAY_StepY] = Int($aPunkte[$x][$ARRAY_StepY])
    Case False
    If $aPunkte[$x][$ARRAY_StepX] = 0 Then $aPunkte[$x][$ARRAY_StepX] = 0.0000001
    If $aPunkte[$x][$ARRAY_StepY] = 0 Then $aPunkte[$x][$ARRAY_StepY] = 0.0000001

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

    ;ein schritt weitersetzen
    $aPunkte[$x][$ARRAY_X] += $aPunkte[$x][$ARRAY_StepX]
    $aPunkte[$x][$ARRAY_Y] += $aPunkte[$x][$ARRAY_StepY]

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

    $iTempX = $aPunkte[$x][$ARRAY_X] + $aPunkte[$x][$ARRAY_StepX]
    $iTempY = $aPunkte[$x][$ARRAY_Y] + $aPunkte[$x][$ARRAY_StepY]

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

    $m = 0
    ;Steigung errechnen
    If $iTempX - $aPunkte[$x][$ARRAY_X] <> 0 Then
    $m = ($iTempY - $aPunkte[$x][$ARRAY_Y]) / ($iTempX - $aPunkte[$x][$ARRAY_X])
    $b = $aPunkte[$x][$ARRAY_Y] - $m * $aPunkte[$x][$ARRAY_X]
    Else
    $m = 0
    EndIf

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

    ;~ ConsoleWrite("m=" & $m & @CRLF)

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

    ;Testen ob der Punkt ein Quadrat berühren wird im nächsten step
    For $i = 0 To $iRectAnz - 1
    If Not _RectCollision($iTempX, $iTempY, 1, 1, $aRect[$i][$ARRAY_X], $aRect[$i][$ARRAY_Y], $aRect[$i][$ARRAY_Width], $aRect[$i][$ARRAY_Height]) Then ContinueLoop
    ;Ermitteln woher der Ball kommt
    #cs
    .__2__
    | |
    1 3
    |__4__|
    #ce
    $ForStep = 1
    If $aPunkte[$x][$ARRAY_StepX] < 0 Then $ForStep = -1

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

    ;Bestimmen woher die Kugel kommt
    For $f = $aPunkte[$x][$ARRAY_X] To $aPunkte[$x][$ARRAY_X] + $aPunkte[$x][$ARRAY_StepX] Step $ForStep
    $y = $m * $f + $b

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

    ;Ecke
    If $f = $aRect[$i][$ARRAY_X] And $y = $aRect[$i][$ARRAY_Y] Then ;oben links
    ConsoleWrite("Ecke: oben links" & @CRLF)
    $aPunkte[$x][$ARRAY_NextStepColl] = 3
    ExitLoop 2
    EndIf

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

    If $f = $aRect[$i][$ARRAY_X] + $aRect[$i][$ARRAY_Width] And $y = $aRect[$i][$ARRAY_Y] Then ;oben rechts
    ConsoleWrite("Ecke: oben rechts" & @CRLF)
    $aPunkte[$x][$ARRAY_NextStepColl] = 3
    ExitLoop 2
    EndIf

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

    If $f = $aRect[$i][$ARRAY_X] + $aRect[$i][$ARRAY_Width] And $y = $aRect[$i][$ARRAY_Y] + $aRect[$i][$ARRAY_Height] Then ;unten rechts
    ConsoleWrite("Ecke: unten rechts" & @CRLF)
    $aPunkte[$x][$ARRAY_NextStepColl] = 3
    ExitLoop 2
    EndIf

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

    If $f = $aRect[$i][$ARRAY_X] And $y = $aRect[$i][$ARRAY_Y] + $aRect[$i][$ARRAY_Height] Then ;unten links
    ConsoleWrite("Ecke: untenlinks" & @CRLF)
    $aPunkte[$x][$ARRAY_NextStepColl] = 3
    ExitLoop 2
    EndIf

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

    ;Seiten
    If $y = $aRect[$i][$ARRAY_Y] And $f >= $aRect[$i][$ARRAY_X] And $f <= $aRect[$i][$ARRAY_X] + $aRect[$i][$ARRAY_Width] Then ; oben
    ConsoleWrite("oben" & @CRLF)
    $aPunkte[$x][$ARRAY_NextStepColl] = 1
    ExitLoop 2
    EndIf
    If $y = $aRect[$i][$ARRAY_Y] + $aRect[$i][$ARRAY_Height] And $f >= $aRect[$i][$ARRAY_X] And $f <= $aRect[$i][$ARRAY_X] + $aRect[$i][$ARRAY_Width] Then ;unten
    ConsoleWrite("unten" & @CRLF)
    $aPunkte[$x][$ARRAY_NextStepColl] = 1
    ExitLoop 2
    EndIf
    If $f = $aRect[$i][$ARRAY_X] And $y >= $aRect[$i][$ARRAY_Y] And $y <= $aRect[$i][$ARRAY_Y] + $aRect[$i][$ARRAY_Height] Then ; links
    ConsoleWrite("links" & @CRLF)
    $aPunkte[$x][$ARRAY_NextStepColl] = 2
    ExitLoop 2
    EndIf
    If $f = $aRect[$i][$ARRAY_X] + $aRect[$i][$ARRAY_Width] And $y >= $aRect[$i][$ARRAY_Y] And $y <= $aRect[$i][$ARRAY_Y] + $aRect[$i][$ARRAY_Height] Then ; rechts
    ConsoleWrite("rechts" & @CRLF)
    $aPunkte[$x][$ARRAY_NextStepColl] = 2
    ExitLoop 2
    EndIf
    Next
    Next
    EndSwitch
    Next
    _WinAPI_BitBlt($hGUIDC, 0, 0, 500, 500, $hDCBackpuffer, 0, 0, $SRCCOPY)
    WEnd

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

    While GUIGetMsg() <> -3
    WEnd

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

    Func _RectCollision($iX1, $iY1, $iWidth1, $iHeight1, $iX2, $iY2, $iWidth2, $iHeight2)
    ;Author: Faweyr
    Return $iX1 + $iWidth1 > $iX2 And $iX1 < $iX2 + $iWidth2 And $iY1 + $iHeight1 > $iY2 And $iY1 < $iY2 + $iHeight2
    EndFunc ;==>_RectCollision

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

    Func _Exit()
    _GDIPlus_GraphicsDispose($hGraphics)
    _WinAPI_DeleteObject($hBitmapBackpuffer)
    _WinAPI_DeleteDC($hDCBackpuffer)
    _WinAPI_ReleaseDC($hGUI, $hGUIDC)
    _GDIPlus_BrushDispose($hBrushPunkte)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    Dateien

    BallDemo.au3 9,14 kB – 643 Downloads BallDemo.PNG 10,7 kB – 0 Downloads
  • Koordinatensytem Wegeberechnung

    • Sprenger120
    • 14. März 2011 um 21:12

    Hi,
    ich hab hier was feines im Englischen Forum gefunden (Link)

  • [GDI] Eine Pixelfarbe (zB 0xFFFFFF) nicht mit zeichen/ transparent machen

    • Sprenger120
    • 14. März 2011 um 21:11

    Hi,
    ich hab hier noch eine schnelle Assembler Lösung. (Quick & Dirty ^^)

    Farbe Transparent machen
    [autoit]

    #AutoIt3Wrapper_UseX64=n
    #include <GDIPlus.au3>
    #include <include/AssembleIt.au3>

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

    ;~ $sFile = FileOpenDialog("", @ScriptDir, "Bild Dateien (*.*)")
    If @error Then Exit
    $sFile = @ScriptDir & "\TestBild.bmp"

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

    _GDIPlus_Startup()
    $hBitmap = _GDIPlus_BitmapCreateFromFile($sFile) ;Hier bitte pfad anpassen <<<<<<<<<<<<<
    $iWidth = _GDIPlus_ImageGetWidth($hBitmap)
    $iHeight = _GDIPlus_ImageGetHeight($hBitmap)

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

    ColorIgno($hBitmap,$iWidth,$iHeight,0xFFFF0000)

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

    $hGUI = GUICreate("", $iWidth, $iHeight)
    GUISetState(@SW_SHOW)

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

    $hGr = _GDIPlus_GraphicsCreateFromHWND($hGUI)

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

    While GUIGetMsg() <> -3
    _GDIPlus_GraphicsDrawImage($hGr, $hBitmap, 0, 0)
    WEnd

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

    Func ColorIgno($hBitmap, $iWidth, $iHeight, $iSearchColor, $iReplaceColor = 0x00000000)
    Local Static $tCodeBuffer = DllStructCreate("byte[30]") ;reserve Memory for opcodes
    DllStructSetData($tCodeBuffer, 1, "0x8B7424048B4C24088B5C240C8B542410391E740683C604E2F7C38916EBF6") ;write opcodes into memory

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

    $tBitmap = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $iWidth, $iHeight, BitOR($GDIP_ILMREAD, $GDIP_ILMWRITE), $GDIP_PXF32ARGB)
    If @error Then Return SetError(1, @error, -1)
    $pBitmap = DllStructGetData($tBitmap, "Scan0")

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

    DllCall("user32.dll", "int", "CallWindowProcW", "ptr", DllStructGetPtr($tCodeBuffer), "ptr", $pBitmap, "int", $iWidth * $iHeight, "int", $iSearchColor, "int", $iReplaceColor)
    _GDIPlus_BitmapUnlockBits($hBitmap, $tBitmap)
    If @error Then Return SetError(2, @error, -1)
    Return True
    EndFunc ;==>ColorIgno

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

    #cs
    Func _ColorIgno()
    _("use32")
    _("mov esi,dword[esp+4]")
    _("mov ecx,dword[esp+8]")
    _("mov ebx,dword[esp+12]")
    _("mov edx,dword[esp+16]")

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

    _("_mainloop:")

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

    _("cmp dword[esi],ebx")
    _("je ignopx")

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

    _("weiter:")

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

    _("add esi,4")
    _("loop _mainloop")

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

    _("ret")

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

    _("ignopx:")
    _("mov dword[esi],edx")
    _("jmp weiter")
    EndFunc ;==>_ColorIgno
    _AssembleIt("int", "_ColorIgno", "ptr", $pBitmap, "int", $iWidth * $iHeight, 0xFF000000, 0x00000000)
    #ce

    [/autoit]


    Farbkanal Ignorieren
    [autoit]

    #AutoIt3Wrapper_UseX64=n
    #include <GDIPlus.au3>
    ;~ #include <include/AssembleIt.au3>

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

    $sFile = FileOpenDialog("", @ScriptDir, "Bild Dateien (*.*)")
    If @error Then Exit

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

    _GDIPlus_Startup()
    $hBitmap = _GDIPlus_BitmapCreateFromFile($sFile) ;Hier bitte pfad anpassen <<<<<<<<<<<<<
    $iWidth = _GDIPlus_ImageGetWidth($hBitmap)
    $iHeight = _GDIPlus_ImageGetHeight($hBitmap)

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

    ;Locken und Pointer hohlen
    $tBitmap = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $iWidth, $iHeight, BitOR($GDIP_ILMREAD, $GDIP_ILMWRITE), $GDIP_PXF32ARGB)
    $pBitmap = DllStructGetData($tBitmap, "Scan0")

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

    ;0xFF00FFFF = Rot wird gekillt
    ;0xFFFF00FF = Grün wird gekillt
    ;0xFFFFFF00 = Blau wird gekillt
    ;Wo FF steht bleibt der Farbkanal bestehen 00 löscht ihn (setzt ihn auf 0)

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

    Global $tCodeBuffer = DllStructCreate("byte[20]") ;reserve Memory for opcodes
    DllStructSetData($tCodeBuffer, 1, "0x8B7424048B4C24088B5C240C211E83C604E2F9C3") ;write opcodes into memory
    $ret = DllCall("user32.dll", "int", "CallWindowProcW", "ptr", DllStructGetPtr($tCodeBuffer), "ptr", $pBitmap, "int", $iWidth * $iHeight, "int", 0xFF00FFFF, "int", 0)

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

    _GDIPlus_BitmapUnlockBits($hBitmap, $tBitmap)
    $hGUI = GUICreate("", $iWidth, $iHeight)
    GUISetState(@SW_SHOW)

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

    $hGr = _GDIPlus_GraphicsCreateFromHWND($hGUI)

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

    While GUIGetMsg() <> -3
    _GDIPlus_GraphicsDrawImage($hGr, $hBitmap, 0, 0)
    WEnd

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

    #cs
    Func _ColorIgno()
    _("use32")
    _("mov esi,dword[esp+4]")
    _("mov ecx,dword[esp+8]")
    _("mov ebx,dword[esp+12]")

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

    _("_mainloop:")
    _("and dword[esi],ebx")
    _("add esi,4")
    _("loop _mainloop")
    _("ret")
    EndFunc ;==>_ColorIgno
    #ce

    [/autoit]

    Dateien

    TestBild.bmp 112,37 kB – 341 Downloads
  • Onreadystatechange...

    • Sprenger120
    • 14. März 2011 um 15:56

    Hi,
    du kannst Objekte genau wie in JavaScript auch in AutoIt benutzen.
    Ist in dieser Zeile HandleStateChange eine Constante oder ist damit die Funktion gemeint ?

    Code
    xmlhttp.onreadystatechange= HandleStateChange;
    [autoit]

    $xmldoc = ""

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

    $oxmlHTTP = ObjCreate("Msxml2.XMLHTTP.6.0")
    $oxmlHTTP.Open("POST", "http://myserver/orders/processorder.asp", False)
    $oxmlHTTP.onreadystatechange = HandleStateChange()
    $oxmlHTTP.Send($xmldoc)

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

    Func HandleStateChange()
    If $oxmlHTTP.readyState = 4 Then MsgBox(0, "", $oxmlHTTP.responseXML.xml)
    EndFunc ;==>HandleStateChange

    [/autoit]
  • Dreifach Geburtstag lars_k (36), monkey (20), qixx(19)

    • Sprenger120
    • 14. März 2011 um 15:48

    Hehehe B-Day³ Alles Guuuuuteee :party:

  • XAMPP sehr langsam

    • Sprenger120
    • 13. März 2011 um 18:58

    Hi,
    das selbe Problem habe ich auch nur mit FileZilla. Das dauert auch ewigkeiten bis das läd :wacko:

  • PHP <--> AutoIt Verschlüsslung

    • Sprenger120
    • 13. März 2011 um 12:22
    Zitat von Beginner095

    Mysql5-Verschlüsselung


    Das ist aber ein Hash generator. Sowas gibt es in der Crypt.au3

    [autoit]

    #include <Crypt.au3>

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

    $sString = Random()
    _Crypt_Startup()

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

    ConsoleWrite("MD2:" & _Crypt_HashData($sString,$CALG_MD2) & @CRLF)
    ConsoleWrite("MD4:" & _Crypt_HashData($sString,$CALG_MD4) & @CRLF)
    ConsoleWrite("MD5:" & _Crypt_HashData($sString,$CALG_MD5) & @CRLF)
    ConsoleWrite("SHA1:" & _Crypt_HashData($sString,$CALG_SHA1) & @CRLF)
    _crypt_shutdown()

    [/autoit]

    Im Anhang sind noch weitere Hash Algorythmen. Quelle: (Link)

    Dateien

    Hash.zip 209,14 kB – 346 Downloads
  • Rückgabewert bei Funktion?!

    • Sprenger120
    • 12. März 2011 um 22:25
    Zitat von AfterNight

    €: Kann man auch direkt ein Run in den Return Wert schreiben?


    Ja klar. Das Run wird ausgeführt und der Rückgabewert von Run wird von Return wiederrum zurückgegeben.

  • AssembleIt incl. Laufzeit-"Debugger" [Update12/04/2012]

    • Sprenger120
    • 11. März 2011 um 23:49

    Hii,
    erst mal großes Lob an Andy :party: der Debugger ist jetzt schon in diesem frühen Beta Stadium richtig Sahne :thumbup: .
    Ich persönlich finde das die GUI eigentlich ganz i.o. ist. Es soll ja ein Debugger sein und kein Kanidat für Germany's Next Topmodel ;)

  • Gleiche Verschlüsselung in PHP und AuotIt

    • Sprenger120
    • 10. März 2011 um 20:27

    Hi,
    ich hatte mal sowas gemacht:

    (Link)

  • [Formel] Etwas fürs Auge

    • Sprenger120
    • 10. März 2011 um 17:29

    Hi,
    hmm Ja bei mir auch. Keine Ahnung woran das liegt ?(

  • String aufsplitten nach länge?

    • Sprenger120
    • 10. März 2011 um 15:02

    Hi,
    ich hab dir mal schnell was gebastelt.

    Spoiler anzeigen
    [autoit]

    Func StringTrimAfter($sString, $iCount)
    Local $iSplit = 0, $aArray[1]
    $iCount = Int($iCount)
    If $iCount <= 0 Then Return -1
    If $iCount >= StringLen($sString) Then
    $aArray[0] = $sString
    Return $aArray
    EndIf
    Do
    $aArray[$iSplit] = StringLeft($sString, $iCount)
    $sString = StringTrimLeft($sString, $iCount)
    $iSplit += 1
    ReDim $aArray[$iSplit + 1]
    Until StringLen($sString) = 0
    ReDim $aArray[$iSplit]
    Return $aArray
    EndFunc ;==>StringTrimAfter

    [/autoit]
  • [Formel] Etwas fürs Auge

    • Sprenger120
    • 10. März 2011 um 14:29

    Hi,
    so erstmal sry für den Doppelpost :rolleyes:, aber ich habs endlich hinbekommen das das Bild so aussieht wie das aus dem Startpost.
    für 600x600 braucht mein Assembler Code, bei mir, rund 4ms.

    So ohne langes gerede. Hier ist der Code:

    Spoiler anzeigen
    [autoit]

    #AutoIt3Wrapper_UseX64=n
    ;~ #include "include/AssembleIt.au3"
    #include <WinAPI.au3>
    #include <WindowsConstants.au3>
    Global $pBitmap, $hBitmap
    Global $iWidth = 600
    Global $iHeight = 600

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

    $hGUI = GUICreate("", $iWidth, $iHeight)
    $hDC_Bitmap = _CreateNewBmp32($iWidth, $iHeight, $pBitmap, $hBitmap)

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

    $tCodeBuffer = DllStructCreate("byte[107]") ;reserve Memory for opcodes
    DllStructSetData($tCodeBuffer, 1, "0x8B7C24048B5C24088B54240C89D0F7E35053BB04000000F7E301C75B5989C831D2F7F35389D3F7E3BBFE080000F7E35B83C0245053C1E818BB02000000F7F383FA00751E5B5888C2B6FFC1E21088E6C1C80888E2891783EF0483E90183F90175BCC35B58BA000000FFEBE9") ;write opcodes into memory
    $Timer = TimerInit()
    $ret = DllCall("user32.dll", "int", "CallWindowProcW", "ptr", DllStructGetPtr($tCodeBuffer), "ptr", $pBitmap, "int", $iWidth, "int", $iHeight, "int", 0)
    $sTime = TimerDiff($Timer)
    $hDC_GUI = _WinAPI_GetDC($hGUI)
    WinSetTitle($hGUI, "", "Etwas fürs Auge | Benötigte Zeit: " & Round($sTime, 1) & "ms |by Blume (Assembler Tune by Sprenger120)")
    GUISetState(@SW_SHOW)

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

    While GUIGetMsg() <> -3
    _WinAPI_BitBlt($hDC_GUI, 0, 0, $iWidth, $iHeight, $hDC_Bitmap, 0, 0, $SRCCOPY)
    WEnd

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

    _WinAPI_ReleaseDC($hGUI, $hDC_GUI)
    _WinAPI_DeleteDC($hDC_Bitmap)
    _WinAPI_DeleteObject($hBitmap)
    $pBitmap = 0
    $tCodeBuffer = 0

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

    Func _CreateNewBmp32($iWidth, $iHeight, ByRef $ptr, ByRef $hbmp) ;erstellt leere 32-bit-Bitmap; Rückgabe $HDC und $ptr und handle auf die Bitmapdaten
    $hcdc = _WinAPI_CreateCompatibleDC(0) ;Desktop-Kompatiblen DeviceContext erstellen lassen
    $tBMI = DllStructCreate($tagBITMAPINFO) ;Struktur der Bitmapinfo erstellen und Daten eintragen
    DllStructSetData($tBMI, "Size", DllStructGetSize($tBMI) - 4);Structgröße abzüglich der Daten für die Palette
    DllStructSetData($tBMI, "Width", $iWidth)
    DllStructSetData($tBMI, "Height", -$iHeight) ;minus =standard = bottomup
    DllStructSetData($tBMI, "Planes", 1)
    DllStructSetData($tBMI, "BitCount", 32) ;32 Bit = 4 Bytes => AABBGGRR
    $adib = DllCall('gdi32.dll', 'ptr', 'CreateDIBSection', 'hwnd', 0, 'ptr', DllStructGetPtr($tBMI), 'uint', 0, 'ptr*', 0, 'ptr', 0, 'uint', 0)
    $hbmp = $adib[0] ;hbitmap handle auf die Bitmap, auch per GDI+ zu verwenden
    $ptr = $adib[4] ;pointer auf den Anfang der Bitmapdaten, vom Assembler verwendet
    ;_arraydisplay($adib)
    _WinAPI_SelectObject($hcdc, $hbmp) ;objekt hbitmap in DC
    Return $hcdc ;DC der Bitmap zurückgeben
    EndFunc ;==>_CreateNewBmp32

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

    #cs
    Func Etwas_Fuers_Auge()
    _("use32")
    ;~ _("org " & Fasmgetbaseptr($FASM))
    _("mov edi,dword[esp+4]")
    _("mov ebx,dword[esp+8]") ;Breite
    _("mov edx,dword[esp+12]") ;Höhe

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

    _("mov eax,edx") ;Pixelanzahl berechnen
    _("mul ebx")

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

    _("push eax")
    _("push ebx")

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

    _("mov ebx,4")
    _("mul ebx")
    _("add edi,eax")
    _("pop ebx")
    _("pop ecx")

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

    _("_mainLoop:")

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

    _("mov eax,ecx")
    _("xor edx,edx")
    _("div ebx")

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

    ;EDX = Mod(ecx,Breite)
    ;EAX = ecx / Breite

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

    _("push ebx");Breite sichern
    _("mov ebx,edx");Breite in ebx schreiben
    _("mul ebx") ; ecx/Breite * Mod (ecx,Breite)
    _("mov ebx,2302")
    _("mul ebx")
    _("pop ebx") ;ebx wiederherstellen

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

    _("add eax,36") ; (36 = Pi²)

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

    _("push eax")
    _("push ebx")

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

    _("shr eax,24") ; 16 Bit nach links schieben | AARRBBGG -> 0000AARR
    _("mov ebx,2")
    _("div ebx")

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

    _("cmp edx,0") ; Prüfen ob ungleich
    _("jne schwarz") ;wenn ja pixel schwärzen

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

    _("pop ebx")
    _("pop eax")

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

    ;RGB zu BGR umrechnen
    _("mov dl,al"); Blau in das low von EDX
    _("mov dh,0xFF");Alpha FF setzen
    _("shl edx,16");16 bit nach links schieben 000000BB -> 00BB0000
    _("mov dh,ah") ;Grün
    _("ror eax,8")
    _("mov dl,ah");Rot

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

    _("_schreibe:")

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

    _("mov dword[edi],edx")
    _("sub edi,4")

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

    _("sub ecx,1")
    _("cmp ecx,1")
    _("jne _mainLoop")

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

    _("ret")

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

    _("schwarz:")
    _("pop ebx")
    _("pop eax")
    _("mov edx,0xFF000000")
    _("jmp _schreibe")
    EndFunc ;==>Etwas_Fuers_Auge

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

    $_ASSEMBLEIT_FLAG = 0
    _AssembleIt("int", "Etwas_Fuers_Auge", "ptr", $pBitmap, "int", $iWidth, "int", $iHeight)
    #ce

    [/autoit]

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™