1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. UEZ

Beiträge von UEZ

  • Schlechte GDI+ Performance auf WinXP

    • UEZ
    • 27. Juni 2009 um 20:58

    Krass, liegt wirklich am Alphachannel!

    Aber wieso läuft das Ding "flüssig" auf meinen beiden Notebooks (Vista x32) mit Alphachannel -> 9A :?:

    Ist mir eigentlich nur per Zufall aufgefallen, da ich selten an der Kiste hocke - eigentlich nur zum Zocken und das auch nur ab und wann! :D

    UEZ

  • Schlechte GDI+ Performance auf WinXP

    • UEZ
    • 27. Juni 2009 um 20:23
    Zitat von FunH@cker

    Also bei mir läuft es flüssig (win XP,AMD Athlon X2 [4X3 GHZ] ,nVidia 8600GT )

    Aber es verbraucht verdammt viele recorsen :|


    Ach ja kommt der Thread nich ins Forum Off-Topic ?

    Du kannst an der Performance Schraube drehen, in dem du die Werte
    $explosion_max_amount = 20, $explosion_max_particle = 20 herab setzt.

    Wenn der Thread besser ins Off-Topic passt, dann ab dort hin damit.

    Mmmhhh, also WinXP kann also auch nicht das Problem sein! Sehr merkwürdig ?(

    Gruß,
    UEZ

  • Schlechte GDI+ Performance auf WinXP

    • UEZ
    • 27. Juni 2009 um 20:15
    Zitat von Oscar

    Die schlechte Performance kann ich bestätigen. Mein System: WinXP, AMD X4 940, ATI HD3870


    Den Anhang nicht in den Beitrag einfügen, sondern nur als Anhang stehen lassen.

    Danke für die Info -hab' mir einen Wolf gesucht...

    Zurück zum Problem. Vielleicht hängt es ja an WinXP, denn du benutzt ja eine ATI Karte.
    Auf meinen beiden Notebooks läuft Vista x32. Auf dem einen Notebook ist sogar auch eine nVidia Karte (NVS 140M).

    Merkwürdig!

    UEZ

  • Schlechte GDI+ Performance auf WinXP

    • UEZ
    • 27. Juni 2009 um 19:49

    Hi,

    wenn ich das GDI+ Programm auf meiner Kiste mit nVidia 8800GT laufen lasse, dann ist die Performance so schlecht, dass man die Pixel einzeln zählen kann.

    Kann jemand das auch bestätigen?

    Meine Kiste:
    WinXP Pro SP3
    Intel Core Duo @ 2.5 GHz
    nVidia 8800GT (neueste Treiber! War auch genauso mit Älteren)

    Mit einigen anderen GDI+ Codes, wie z.B. AUTOITEROIDS, und auf meinen 2 Notebooks gibt es keine Probleme!

    Hier der Code:

    Spoiler anzeigen

    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/so
    #AutoIt3Wrapper_Res_SaveSource=n
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Run_After=upx.exe --best "%out%"
    #AutoIt3Wrapper_Run_After=del /f /q "Explosions (from AutoIteroids)_Obfuscated.au3"
    #include <GuiConstantsEx.au3>
    #include <GDIPlus.au3>
    #include <Array.au3>

    Opt('MustDeclareVars', 1)
    Global $hGUI, $hWnd, $hGraphic, $width, $height
    $width = @DesktopWidth * 0.75
    $height = @DesktopHeight * 0.75
    Global Const $explosion_step = 6, $explosion_length = ($width + $height) / 8, $explosion_max_amount = 20, $explosion_max_particle = 20
    Global $explosion_coordinate[$explosion_max_particle][6 * $explosion_max_amount] ; on/off, x, y, vx, vy, v
    Global $explosion_amount = 0
    ; Create GUI
    $hGUI = GUICreate("Explosions (from AUTOITEROIDS) using GDI+ by UEZ 2009!", $width, $height)
    $hWnd = WinGetHandle($hGUI)
    _GDIPlus_Startup()
    Global $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
    Global $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics)
    Global $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
    _GDIPlus_GraphicsClear($backbuffer)
    _GDIPlus_GraphicsSetSmoothingMode($backbuffer, 4)
    Global $pen_size = 1
    Global $pen_color = 0xAFFF8070
    Global $pen = _GDIPlus_PenCreate($pen_color, $pen_size)
    GUISetState()

    Do
    _GDIPlus_GraphicsClear($backbuffer, 0x9A000000)
    If Mod(Random(1, 10, 1), 9) >= 5 Then ;
    Explosion_Init(Random(50, $width - 50, 1), Random(50, $height - 50, 1))
    EndIf
    Explosion()
    _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height)
    Until Not Sleep(30) Or GUIGetMsg() = $GUI_EVENT_CLOSE

    ; Clean up resources
    _GDIPlus_PenDispose($pen)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_GraphicsDispose($graphics)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_Shutdown()


    Func Explosion_Init($ex, $ey) ;initialise explosion
    For $o = 0 To $explosion_step * ($explosion_max_amount - 1) Step $explosion_step ;fill array with coordinate of hit object
    If $explosion_coordinate[0][$o] <> 1 Then
    $explosion_coordinate[0][$o] = 1
    $explosion_coordinate[0][$o + 1] = $ex ;save x coordinate
    $explosion_coordinate[0][$o + 2] = $ey ;save x coordinate
    For $n = 0 To $explosion_max_particle - 1
    $explosion_coordinate[$n][$o + 1] = $explosion_coordinate[0][$o + 1] ;duplicate x start position of all explosion particles
    $explosion_coordinate[$n][$o + 2] = $explosion_coordinate[0][$o + 2] ;duplicate y start position of all explosion particles
    $explosion_coordinate[$n][$o + 3] = _Random(-7, 7, 1) ;create random x vector (explosion particle speed)
    $explosion_coordinate[$n][$o + 4] = _Random(-7, 7, 1) ;create random y vector (explosion particle speed)
    $explosion_coordinate[$n][$o + 5] = Abs($explosion_coordinate[$n][3 + $o]) + Abs($explosion_coordinate[$n][4 + $o]) ;add absolute distance of vectors x and y
    Next
    ExitLoop
    EndIf
    Next
    EndFunc ;==>Explosion_Init

    Func Explosion() ;draw explosions coordinates
    Local $q, $k
    $explosion_amount = 0
    For $k = 0 To $explosion_step * ($explosion_max_amount - 1) Step $explosion_step
    If $explosion_coordinate[0][$k] = 1 Then ;only draw active explosions
    $explosion_amount += 1
    For $q = 0 To $explosion_max_particle - 1
    $explosion_coordinate[$q][$k + 1] += $explosion_coordinate[$q][$k + 3] ;draw new x coordinate of a particle
    $explosion_coordinate[$q][$k + 2] += $explosion_coordinate[$q][$k + 4] ;draw new y coordinate of a particle
    $explosion_coordinate[$q][$k + 5] += Abs($explosion_coordinate[$q][$k + 3]) + Abs($explosion_coordinate[$q][$k + 4])
    If $explosion_coordinate[$q][$k + 5] <= $explosion_length Then ;draw until max. distance has been reached
    _GDIPlus_GraphicsDrawEllipse($backbuffer, $explosion_coordinate[$q][$k + 1], $explosion_coordinate[$q][$k + 2], 2, 2, $pen)
    Else ;when max. distance has been reached then set x vector and y vector to 0
    $explosion_coordinate[0][$k] = 0
    EndIf
    Next
    EndIf
    Next
    ConsoleWrite($explosion_amount & @CRLF)
    EndFunc ;==>Explosion

    Func _Random($w1, $w2, $w3 = 0) ;just to avoid 0 as random number
    Local $x = 0, $l1 = 0.50
    While $x = 0
    $x = Random($w1, $w2, $w3)
    If $x < $l1 And $x >= 0 Then $x += $l1
    If $x > -$l1 And $x <= 0 Then $x -= $l1
    WEnd
    Return $x
    EndFunc ;==>_Random

    Kann sich jemand vorstellen, warum das so ist?

    Gruß,
    UEZ

    PS: wie kann ich die Anzahl der Downloads von Anhängen (s.o.) darstellen? ?(

  • Gdi+ Clone/Save

    • UEZ
    • 20. Juni 2009 um 16:48

    Viele Wege führen nach Rom, hier ein weiterer Weg:

    Spoiler anzeigen


    #include <GDIplus.au3>
    _GDIPlus_Startup()
    Global $bitmap_from_file = _GDIPlus_BitmapCreateFromFile("c:\windows\System32\oobe\info\background_wc.png")
    Global Const $iX = _GDIPlus_ImageGetWidth($bitmap_from_file)
    Global Const $iY = _GDIPlus_ImageGetHeight($bitmap_from_file)
    Global Const $width = $iX
    Global Const $height = 2 * $iY
    Global $hwnd = GUICreate("", $width, $height)
    Global $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
    Global $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics)
    Global $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
    _GDIPlus_GraphicsDrawImage($backbuffer, $bitmap_from_file, 0, 0)
    _GDIPlus_GraphicsDrawImage($backbuffer, $bitmap_from_file, 0, $iY)
    GUISetState()

    Do
    _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height)
    Until GUIGetMsg() = -3 * Sleep(30)

    _GDIPlus_ImageSaveToFile($bitmap, @ScriptDir & "\Test.bmp")
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_GraphicsDispose($graphics)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_Shutdown()

    Exit

    Gruß,
    UEZ

  • Gdi+ Clone/Save

    • UEZ
    • 20. Juni 2009 um 13:13
    Zitat von ChaosKeks

    Guten Morgen!
    Ich poste einfach mal, weil ich eine totale niete in gdi+ bin und zu faul bin um projekte wie autoitoerids durchzuschauen...
    Wie kann ich ein Pic nehmen, dann clonen und unter das ursprungsbild tun und dann wieder speichern?

    Clonen und Speichern ist eigendlich kla (_GDIPlus_BitmapCloneArea + _GDIPlus_ImageSaveToFile) .. trotzdem hab ich den dreh noch nich raus :thumbdown:

    Naja sollte für die Gdi-Experten doch hoffentlich nicht schwer sein!

    -Chaos

    Moin,

    in AUTOITEROIDS wird du nicht weiter kommen, denn da werden "nur" rudimäntere GDI+ Befehle benutzt! ;)

    Wenn ich dich richtig verstanden habe, willst du ein Bild laden und es clonen, so dass das Bild unter dem Original Bild liegt.

    Schaue doch einfach mal unter http://www.autoitscript.com/forum/index.php?showtopic=87200 das Beispiel #07 Visualization: Analog Meter dir genauer an. Ich lade das Bild und clone es auf die rechte Seite!

    Zum Speichern kannst du den Befehl _GDIPlus_ImageSaveToFile($Bitmap, @ScriptDir & "\Bild.jpg") benutzen!

    Ich hoffe, dass ich dir weiter helfen konnte!

    Gruß,
    UEZ

  • [SPIEL] AUTOITEROIDS v1.019 (Final): ein Klon des Arcade Klassikers Asteroids von 1979 (Atari) (Stand: 2016-01-14)

    • UEZ
    • 15. Juni 2009 um 08:19

    @ChaosKeks & AutoBert: Danke für das Feedback. :) Ich freue mich, dass euch das Spiel gefällt.

    Zu den Tasten: vielleicht sollte ich ein Settingsmenue schreiben, wo jeder die Tasten so legen kann, wie er/sie möchte (btw, Alt Gr schießt auch)!

    autoBert: was passiert beim Streiken deiner Strg Taste? Kein Schießen mehr möglich?

    Zu den Cheats: da der Code offen ist, kann ja ehe jeder schummeln und den Highscore so drehen, wie er will. Mit den Cheats macht es kaum Spaß!
    Ich habe sie zum testen benötigt und einfach drinne gelassen, auch um zu sehen, ob sie jemanden auffallen. :whistling:

    Ansonsten viel Spaß beim Ballern! ;)

    Gruß,
    UEZ

  • [SPIEL] AUTOITEROIDS v1.019 (Final): ein Klon des Arcade Klassikers Asteroids von 1979 (Atari) (Stand: 2016-01-14)

    • UEZ
    • 14. Juni 2009 um 21:47

    Ich wollte nur mitteilen, dass ich jetzt die finale Version des Spiels fertig gestellt habe!

    Falls jemand noch interesse hat, einfach im ersten Post nachschauen und herunterladen!

    Viel Spaß beim Ballern!

    UEZ

  • Auto Ball Spiel

    • UEZ
    • 1. Juni 2009 um 19:31

    Ein nettes Tutorial über Kollision kannst du hier finden: http://www.johanvanmol.org/content/category/6/23/37/ (Collision detection & bouncing part 1-3). Ist zwar für Flash, aber sehr gut erklärt (in Englisch)!

    Kollision allgemein ist sehr komplex und nicht trivial, wobei die Kollision mit Kugel die einfachste Variante ist!

    AUTOITEROIDS habe ich nun zu 99% fertig gestellt - es fehlt nur noch ein "Credit Intro".

    Gruß,
    UEZ

  • Auto Ball Spiel

    • UEZ
    • 28. Mai 2009 um 13:43
    Zitat von moritz1243

    @ UEZ hast recht danke für die funktion ;) Aus deinem AutoIteroids Spiel oder?

    Nicht nur :D Ich benutze sie auch z.B. in "Simple Ball Collision Simulation".


    Das Verhaken ist wirklich nicht einfach zu lösen, hab' das auch bei den Kugeln ^^

    UEZ

  • Auto Ball Spiel

    • UEZ
    • 28. Mai 2009 um 10:18

    Ich habe deinen Code schnell überflogen und mir ist folgendes aufgefallen:

    1) du berechnest $pi/180 immer, obwohl $pi/180 eine Konstante ist
    Vorschlag: Global Const $pi_div_180 = 4 * ATan(1) / 180

    2) auch die Potenz von Zahlen ist langsamer als die Multiplikation, d.h. a^2 = a*a. Kannst ja bei deiner Pythagoras Berechnung berücksichtigen!

    Ich habe mir dafür eine Funktion geschrieben:

    Func Pixel_Distance($x1, $y1, $x2, $y2) ;Pythagoras theorem
    Local $a, $b, $c
    If $x2 = $x1 And $y2 = $y1 Then
    Return 0
    Else
    $a = $y2 - $y1
    $b = $x2 - $x1
    $c = Sqrt($a * $a + $b * $b)
    Return $c
    EndIf
    EndFunc ;==>Pixel_Distance

    Ansonsten Top!

    UEZ

  • Auto Ball Spiel

    • UEZ
    • 27. Mai 2009 um 22:01

    Saubere Arbeit. :thumbup:

    Was mir aufgefallen ist: bei einem Tor sollte sich der Ball auch hinter die Torlinie bewegen!

    Respekt!

    Was war denn die größte Herausforderung?

    Gruß,
    UEZ

  • [SPIEL] AUTOITEROIDS v1.019 (Final): ein Klon des Arcade Klassikers Asteroids von 1979 (Atari) (Stand: 2016-01-14)

    • UEZ
    • 26. Mai 2009 um 22:25
    Zitat von AutoBert

    Hallo UEZ,

    gelungene Umsetzung des Spiels :thumbup: , hat mich sofort 30 Jahre jünger gemacht, hab gedaddelt bis ich ich Ladehemmung hatte (STRG-Taste muss ich mal nachkontrolieren). Weiter so und großes Lob :thumbup: ,

    mfg (Auto)bert

    Ich war so um die 12 Jahre als ich das erste Mal vor der Kiste stand und Asteroids bewunderte - das ist auch schon ca. 25 Jahre her! Man wie die Zeit vergeht... ;(


    Btw, ich glaube ich habe die Explosionsgeräusche vergessen zu aktivieren:

    einfach in der Funktion Func Explosion_Init($ex, $ey) die Zeile If $start_game = 1 Then Explosion_Sound() vor der EndFunc einfügen! SORRY!

    In der nächsten, sehr wahrscheinlich Final Version, werden die Explosionsgeräusche wieder da sein!

    Gruß,
    UEZ

  • [SPIEL] AUTOITEROIDS v1.019 (Final): ein Klon des Arcade Klassikers Asteroids von 1979 (Atari) (Stand: 2016-01-14)

    • UEZ
    • 25. Mai 2009 um 09:40
    Zitat von Gianni

    Hallo UEZ

    Unglaublich, heute ging mir die genau gleiche idee durch den kopf.hab das spiel früher mal für flash / action script programmiert. Dann kamm mir noch ein anderes Spiel (Klassiker) in den sinn, dass ich auch mal programmiert hatte. und zwar ist es arkanoid / breakout..

    vielleicht könnte es eine idee für das nächste spiel sein..??!!

    grüsse

    Ich werde genau deinen Weg gehen, aber nur anders herum: ich werde jetzt mit Flash respektive C/C++ anfangen. Ohne C/C++ kommt man nicht sehr weit :(

    Vielleicht werde ich ja ein Game in Flash erstellen, aber bis dahin ist es noch sehr weit...

    Gruß,
    UEZ

    PS: Ach ja, ich bin auch kein AutoIt Meister :!:

  • [SPIEL] AUTOITEROIDS v1.019 (Final): ein Klon des Arcade Klassikers Asteroids von 1979 (Atari) (Stand: 2016-01-14)

    • UEZ
    • 24. Mai 2009 um 21:34

    Danke für das Feedback ;)

    In der Tat habe ich vergessen zu schreiben, dass mit der Strg (Ctrl) Taste geschissen geschossen werden kann :P - hab's korrigiert.

    Und AUTOITEROIDS ist keine Krankheit :rofl:

    UEZ

    PS: Ich bin kein GDI+ Meister :!:

  • [SPIEL] AUTOITEROIDS v1.019 (Final): ein Klon des Arcade Klassikers Asteroids von 1979 (Atari) (Stand: 2016-01-14)

    • UEZ
    • 24. Mai 2009 um 16:08

    AUTOITEROIDS (Final): ein Clone des Arcade Spielhallen Klassikers Asteroids von 1979 (Atari)

    [Blockierte Grafik: https://www.autoitscript.com/forum/uploads/monthly_05_2009/post-29844-1242504010.png]


    Steuerung:

    • Pfeil nach oben: Schub
    • Pfeil nach links: Drehung nach links
    • Pfeil nach rechts: Drehung nach rechts
    • Strg (Ctrl): Schießen
    • Space Taste: Hypersprung

    Game Play:

    • Spiel fängt mit 3 Asteroiden an
    • alle 10.000 Pukte erhöht sich der Level (u.a. # Asteroiden + 1)
    • alle 30.000 Punkte extra Leben
    • größter Asteroid = 20 Punkte
    • mittlere Asteroid = 50 Punkte
    • kleinster Asteroid = 100 Punkte
    • großes Alien Schiff = 200 Punkte
    • kleines Alien Schiff = 1000 Punkte

    Download:

    • Source Code + Exe Version: v1.019 Build 2012-07-30 (Download weiter unten!)
    • --=> (.7z Archiv kann z.B. mit 7-Zip entpackt werden!)
    • Compilierte Version ohne Quellcode: HIER (v1.019 Build 2012-07-30)

    Credits:

    • Haupt Code: UEZ
    • Bass UDF: BrettF
    • Bass DLL: http://www.un4seen.com/
    • GDI+ Font Lader Code: Yashied
    • Font: ck! [Freaky Fonts]
    • Sound + Sound Code Modifizierung: Spiff59
    • GetKeyboardState code: Eukalyptus

    Zu finden auch hier (inkl. Change Log): http://www.autoitscript.com/forum/index.php?showtopic=95138


    Online zocken: ASTEROIDS (Java Version) :P


    Viel Spaß beim Ballern ^^
    UEZ

    Dateien

    AUTOITEROIDS v1.019 Build 2016-01-14.7z 637,84 kB – 451 Downloads
  • GDI+ Visualization: Analog Meter

    • UEZ
    • 17. März 2009 um 12:54

    Ich hab's rausgefunden. DL Link und Quellcode aktualisiert (1. Post).

    Die Pegelauschläge hängen nun von der Lautstärke ab.

    Gruß,
    UEZ

  • GDI+ Visualization: Analog Meter

    • UEZ
    • 16. März 2009 um 22:04
    Zitat von eukalyptus

    Auch unter Vista gibt es den Stereomix um den Output aufzunehmen:

    Rechtsklick auf das Lautsprechersymbol -> Aufnahmegeräte -> Rechtsklick -> "deaktivierte Geräte anzeigen"
    Dann erscheinen dann alle möglichen Devices, welche man dann aktivieren kann.

    _BASS_RecordInit($bass_dll, -1) der Parameter gibt das Aufnahmegerät an, wird bei UEZ warscheinlich 2 sein...(-1 = Default, wahrscheinlich Mikro)
    Weiß allerdings nocht nicht, wie man automatisch erkennt, welcher der richtige ist...

    lgE

    Ehrlich gesagt habe ich auch nicht weiter geforscht :whistling:

    Bei mir wird leider nicht mehr erkannt als Microphone und LineIn!

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


    Ich werde versuchen, die Lautstärke mit einzubeziehen, so dass, wenn die Lautstärke leise ist, die Pegel Ausschäge weniger sind. D.h. je lauter desto mehr Pegel Ausschläge.

    Ich habe noch nicht nachgeforscht, ob bass.dll die Lautstärke auslesen kann und ob Vista kompatibel.

    UEZ

  • GDI+ Visualization: Analog Meter

    • UEZ
    • 13. März 2009 um 18:57
    Zitat von Dankeschön

    Darf ich die Visualisierung für meinen Media Player nutzen?
    Nach genauso etwas suche ich schon lange....

    JA! Nur würde ich gerne bei den "Credits" auftauchen. :P

    Hinweis: Bass.au3, Bass.dll und das Bild sind nicht mein geistiges Eigentum :!:

    Bitteschön,
    UEZ

  • GDI+ Visualization: Analog Meter

    • UEZ
    • 13. März 2009 um 16:22
    Zitat von K1773R

    @UEZ
    da haben ma das problem schon! ich hab kA von dem ^^ zudem versteh ich nurn teil des codes

    Hier die Modifikation des Codes:

    Spoiler anzeigen


    ;code by UEZ 2009
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/SO
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Run_After=upx.exe --best "%out%"

    #include <GUIConstantsEx.au3>
    #include <GDIplus.au3>
    #include <WindowsConstants.au3>
    #include "Bass.au3" ;thanks to BrettF

    Opt("GUIOnEventMode", 1)

    _GDIPlus_Startup()
    $bitmap_from_file = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\AIMP_VU.bmp") ;thanks to AIMP2 player ;)
    Global Const $iX = _GDIPlus_ImageGetWidth($bitmap_from_file)
    Global Const $iY = _GDIPlus_ImageGetHeight($bitmap_from_file)

    Global Const $bass_dll = DllOpen(@ScriptDir & "\BASS.dll")
    _BASS_SetConfig($bass_dll, $BASS_CONFIG_REC_BUFFER, 1000)

    _BASS_RecordInit($bass_dll, -1)

    ;thanks to eukalyptus
    $Cnt = 0
    $Name = _BASS_RecordGetInputName($bass_dll, 0)
    While $Name <> ""
    $Input = _BASS_RecordGetInput($bass_dll, $Cnt)
    If BitAND($Input[0], $BASS_INPUT_TYPE_WAVE) Then _BASS_RecordSetInput($bass_dll, $Cnt, $BASS_INPUT_TYPE_WAVE, 1)
    $Cnt += 1
    $Name = _BASS_RecordGetInputName($bass_dll, $Cnt)
    WEnd

    If @OSVersion = "WIN_VISTA" Or @OSVersion = "WIN_2008" Then _BASS_RecordSetInput($bass_dll, 0, $BASS_INPUT_TYPE_WAVE, 1)

    $RecHandle = _BASS_RecordStart($bass_dll, 44100, 2, _WinAPI_MakeLong(0, 10))


    Global Const $width = $iX * 2
    Global Const $height = $iY

    $hwnd = GUICreate("", $width, $height, -1, -1, Default, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
    GUISetOnEvent($GUI_EVENT_CLOSE, "close")
    GUISetState()

    $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics)
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
    _GDIPlus_GraphicsSetSmoothingMode($backbuffer, 4)

    Global Const $pen_size = 2
    $pen = _GDIPlus_PenCreate(0, $pen_size)
    $brush_l = _GDIPlus_BrushCreateSolid()
    $brush_r = _GDIPlus_BrushCreateSolid()
    _GDIPlus_GraphicsDrawImage($backbuffer, $bitmap_from_file, 0, 0)
    _GDIPlus_GraphicsDrawImage($backbuffer, $bitmap_from_file, $iX, 0)

    Global Const $pi = 3.1415926535897932384626433832795
    Global Const $pi_div_180 = $pi / 180
    Global Const $max_amplitude = 450
    Global Const $min_x = 25
    Global Const $max_x = 160
    Global Const $pointer_ini_point_y = 80 ;less is longer
    Global Const $pointer_start_y = 93
    Global Const $pointer_length = 65
    Global Const $ellipse_size = 8
    Global Const $ellipse_size_half = $ellipse_size / 2
    Global Const $width_div_4 = $width / 4
    Global Const $width_div_2 = $width / 2

    Dim $title[19] = ["º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`", _
    "GDI+ Visualization: Analog Meter", _
    "Credits:", _
    "Main coding by: UEZ 2009", _
    "Bass UDF: BrettF", _
    "Bass Record Function Code: eukalyptus", _
    "Bass DLL: https://autoit.de/www.un4seen.com", _
    "Image: AIMP Player", _
    "Music: ACC:Xess", _
    "For more music visit: ", _
    "http://remix.kwed.org (C64 Remakes / Remixes)", _
    "And of course", _
    "AutoIt developers ;-)", _
    "•*´¯`*•.¸ .. ¥ .. ¸.•*´¯`*•*´¯`*•.¸ .. ¥ .. ¸.•*´¯`*•*´¯`*•.¸ .. ¥ .. ¸.•*´¯`*.¸ .. ¥ .. ¸.•*´¯", _
    "Greetings to: ", _
    "All members from", _
    "www.autoitscript.com / https://autoit.de/www.autoit.de", _
    " ", _
    "Restarting text..."]

    Global $c = 0 ;counter for sleep
    Global $i = 1 ;for character
    Global $j = 0 ;for array
    Global $k = UBound($title) - 1
    Global $s = 150 ;sleep time
    Global $in = True
    Global $effect = Random(1, 2, 1)

    $g = 0x00
    $b = 0x00

    Do
    $levels = _BASS_ChannelGetLevel($bass_dll, $RecHandle)
    $LeftChLvl = _WinAPI_LoWord($levels) * 135 / 0x1500
    $RightChLvl = _WinAPI_HiWord($levels) * 135 / 0x1500

    $l_x2 = $min_x + $max_x * ($LeftChLvl / $max_amplitude)
    If $l_x2 >= $max_x Then $l_x2 = $max_x
    $l_y2 = $pointer_ini_point_y - Sin($l_x2 * $pi_div_180) * $pointer_length

    $r_x2 = $min_x + $max_x * ($RightChLvl / $max_amplitude)
    If $r_x2 >= $max_x Then $r_x2 = $max_x
    $r_y2 = $pointer_ini_point_y - Sin($r_x2 * $pi_div_180) * $pointer_length

    _GDIPlus_PenSetColor($pen, 0xCF111111)
    _GDIPlus_GraphicsDrawLine($backbuffer, $width_div_4 - 1, $pointer_start_y, $l_x2, $l_y2, $pen)
    _GDIPlus_GraphicsDrawLine($backbuffer, $width - $width_div_4 - 1, $pointer_start_y, $width_div_2 + $r_x2, $r_y2, $pen)

    $r = $LeftChLvl * ($LeftChLvl / 0xFF)
    _GDIPlus_BrushSetSolidColor($brush_l, "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2))
    _GDIPlus_GraphicsFillEllipse($backbuffer, $width_div_4 - $ellipse_size_half - 1, $pointer_start_y - $ellipse_size_half, $ellipse_size, $ellipse_size, $brush_l)

    $r = $RightChLvl * ($RightChLvl / 0xFF)
    _GDIPlus_BrushSetSolidColor($brush_r, "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2))
    _GDIPlus_GraphicsFillEllipse($backbuffer, $width - $width_div_4 - $ellipse_size_half - 1, $pointer_start_y - $ellipse_size_half, $ellipse_size, $ellipse_size, $brush_r)

    _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height)
    _GDIPlus_GraphicsDrawImage($backbuffer, $bitmap_from_file, 0, 0)
    _GDIPlus_GraphicsDrawImage($backbuffer, $bitmap_from_file, $iX, 0)
    Sleep(25)
    Display_Info()
    Until False

    Func Display_Info()
    If $in Then
    If $i <> StringLen($title[$j]) + 1 Then
    If $effect = 1 Then
    WinSetTitle($hwnd, "", StringLeft($title[$j], $i)) ;effect 1a, 1 by 1
    Else
    WinSetTitle($hwnd, "", StringRight($title[$j], $i)) ;effect 2a, scroll to right
    EndIf
    $i += 1
    Else
    If $c = $s Then
    $i = 1
    $in = False
    $c = 0
    $effect = Random(1, 2, 1)
    Else
    $c += 1
    EndIf
    EndIf
    Else
    If $i <> StringLen($title[$j]) + 1 Then
    If $effect = 1 Then
    WinSetTitle($hwnd, "", StringLeft($title[$j], StringLen($title[$j]) - $i)) ;effect 1b, 1 by 1
    Else
    WinSetTitle($hwnd, "", StringRight($title[$j], StringLen($title[$j]) - $i)) ;effect 2b, scroll to left
    EndIf
    $i += 1
    Else
    $i = 1
    $in = True
    $effect = Random(1, 2, 1)
    If $j = $k Then
    $j = 0
    Else
    $j += 1
    EndIf
    EndIf
    EndIf
    EndFunc ;==>Display_Info

    Func close()
    _BASS_Free($bass_dll)
    DllClose($bass_dll)
    _GDIPlus_PenDispose($pen)
    _GDIPlus_BrushDispose($brush_l)
    _GDIPlus_BrushDispose($brush_r)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_GraphicsDispose($graphics)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>close

    ; #FUNCTION# ====================================================================
    ; Name...........: _GDIPlus_BrushSetSolidColor
    ; Description ...: Set the color of a Solid Brush object
    ; Syntax.........: _GDIPlus_BrushSetSolidColor($hBrush, [$iARGB = 0xFF000000])
    ; Parameters ....: $hBrush - Handle to a Brush object
    ; $iARGB - Alpha, Red, Green and Blue components of brush
    ; Return values .: Success - True
    ; Failure - False
    ; Author ........:
    ; Modified.......: smashly
    ; Remarks .......:
    ; Related .......:
    ; Link ..........; @@MsdnLink@@ GdipSetSolidFillColor
    ; Example .......; Yes
    ; ================================================================================
    Func _GDIPlus_BrushSetSolidColor($hBrush, $iARGB = 0xFF000000)
    Local $aResult
    $aResult = DllCall($ghGDIPDll, "int", "GdipSetSolidFillColor", "hwnd", $hBrush, "int", $iARGB)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
    EndFunc ;==>_GDIPlus_BrushSetSolidColor

    Vielen Dank an eukalyptus für den Teil des Codes!

    Achtung: auf Vista funzt das Ganze nicht richtig. Z.B. bekomme ich nur über das Mikrofon die Levels angezeigt. Außerdem kann ich es auf XP momentan nicht testen und kann auch zu den Zeigerausschlägen nicht sagen, ob die ok sind.

    Ansonsten einfach den Hex Teiler entsprechend im Code für $LeftChLvl bzw. $RightChLvl ändern.


    UEZ

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™