Grafische Spielerei

  • Eigentlich war das Script nur ein Langeweile Projekt eines freien Nachmittages, aber weil es (meiner Meinung nach) doch recht gut aussieht stell ich es mal hier rein.

    Spoiler anzeigen
    [autoit]

    Global $iFrames = 150
    Global $iFPS = 20
    Global $iStars = Random(500,3000,1)
    Global $iSeed = Random(1,1000000,1)
    Global $iRadius = Random(50,200,1)
    Opt("GUIOnEventMode",1)
    Local Const $iRtoD = ACos(-1)/180
    #include<GDIPlus.au3>
    _GDIPlus_Startup()
    Local $hGUI = GUICreate("Grafik User Interface",500,500,-1,-1)
    GUISetOnEvent(-3,"_exit",$hGUI)
    $hCMenue = GUICtrlCreateContextMenu()
    $hCMenue_Neu = GUICtrlCreateMenu("Neu",$hCMenue)
    $hCMenue_Neu_Neu = GUICtrlCreateMenuItem("Neu",$hCMenue_Neu)
    GUICtrlSetOnEvent($hCMenue_Neu_Neu,"Neu")
    $hCMenue_Neu_Zufaellig = GUICtrlCreateMenuItem("Zufällig",$hCMenue_Neu)
    GUICtrlSetOnEvent($hCMenue_Neu_Zufaellig,"Zufallig")
    $hCMenue_FPS = GUICtrlCreateMenu("Bildrate",$hCMenue)
    $hCMenue_FPS_5 = GUICtrlCreateMenuItem("5",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_5,"FPS_05")
    $hCMenue_FPS_10 = GUICtrlCreateMenuItem("10",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_10,"FPS_10")
    $hCMenue_FPS_15 = GUICtrlCreateMenuItem("15",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_15,"FPS_15")
    $hCMenue_FPS_20 = GUICtrlCreateMenuItem("20",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_20,"FPS_20")
    $hCMenue_FPS_25 = GUICtrlCreateMenuItem("25",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_25,"FPS_25")
    $hCMenue_FPS_30 = GUICtrlCreateMenuItem("30",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_30,"FPS_30")
    $hCMenue_FPS_Mehr = GUICtrlCreateMenuItem("Mehr...",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_Mehr,"FPS_")
    $hCMenue_Copy = GUICtrlCreateMenuItem("Kopieren",$hCMenue)
    GUICtrlSetOnEvent($hCMenue_Copy,"Copy")
    $hCMenue_Paste = GUICtrlCreateMenuItem("Einfügen",$hCMenue)
    GUICtrlSetOnEvent($hCMenue_Paste,"Paste")
    Local $hGrafik = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    Local $hBufferBitmap = _GDIPlus_BitmapCreateFromGraphics(500,500,$hGrafik)
    Local $hBufferContext = _GDIPlus_ImageGetGraphicsContext($hBufferBitmap)
    GUISetState(1,$hGUI)
    Global $aBitmaps = Create($iFrames,$iStars,$iSeed,$iRadius)

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

    Local $iTimer = TimerInit()
    Local $iFrame = 0
    Do
    $iFrame = Mod(Timerdiff($iTimer)/(1000/$iFPS),$iFrames)
    _GDIPlus_GraphicsDrawImage($hGrafik,$aBitmaps[$iFrame],0,0)

    Until 0

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

    Func Create($iFrames,$iStars,$iSeed,$iRadius)
    GUICtrlSetState($hCMenue_Neu,128)
    GUICtrlSetState($hCMenue_Paste,128)
    Local $iSSeed = 0, $iDistanz = 0, $iWinkel = 0,$iTife = 0, $iFarbe = 0, $hContext = 0x00
    Local $aBrush[7]
    Local $aBitmap[$iFrames]

    $aBrush[0] = _GDIPlus_BrushCreateSolid(0x999999FF)
    $aBrush[1] = _GDIPlus_BrushCreateSolid(0x99FFFF99)
    $aBrush[2] = _GDIPlus_BrushCreateSolid(0x99FFFFFF)
    $aBrush[3] = _GDIPlus_BrushCreateSolid(0x99FF9999)
    $aBrush[4] = _GDIPlus_BrushCreateSolid(0xFFFF9999)
    $aBrush[5] = _GDIPlus_BrushCreateSolid(0x99FF4444)
    $aBrush[6] = _GDIPlus_BrushCreateSolid(0xFF774444)

    If $iSeed = 4474194 Then
    $hBrush = _GDIPlus_BrushCreateSolid(0x88FF0000)
    Else
    $hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    EndIf
    $hPen = _GDIPlus_PenCreate(0xFFFFFFFF,2)
    _GDIPlus_GraphicsClear($hBufferContext,0xFF000000)
    _GDIPlus_GraphicsClear($hGrafik,0xFF000000)

    Local $iSeed2 = Mod(Round($iSeed,2),ACos(-1))*(100/ACos(-1))
    For $i = 0 to $iFrames-1
    $aBitmap[$i] = _GDIPlus_BitmapCreateFromGraphics(500,500,$hGrafik)
    $hContext = _GDIPlus_ImageGetGraphicsContext($aBitmap[$i])
    _GDIPlus_GraphicsClear($hContext,0xFF000000)
    For $ii = 1 to $iStars
    $iSSeed = $iSeed2*$ii
    $iDistanz = Mod($iSSeed,1)*$iRadius
    $iWinkel = Mod(Mod($iSSeed,0.36)*1000 + ($i+1)/$iFrames*360,360)
    $iTife = (Mod($iSSeed,0.5)-0.25)*Mod($iSSeed,100);$iSSeed/100
    If $iSeed = 4474194 Then
    $iFarbe = Int($iDistanz / $iRadius*2)+5
    Else
    $iFarbe = Int($iDistanz / $iRadius*5)
    EndIf
    _GDIPlus_GraphicsFillRect($hContext,250 + Sin($iRtoD*$iWinkel)*$iDistanz,250 + Cos($iRtoD*$iWinkel)*$iDistanz*0.50 + $iTife,1,1,$aBrush[$iFarbe])
    Next
    _GDIPlus_GraphicsDispose($hContext)
    If $i = 0 Then
    _GDIPlus_GraphicsDrawImage($hBufferContext,$aBitmap[0],0,0)
    _GDIPlus_GraphicsDrawRect($hBufferContext,175,240,150,20,$hPen)
    Local $aArray[5][2] = [[4]]
    $aArray[1][0] = 174
    $aArray[1][1] = 227
    $aArray[2][0] = 190+30
    $aArray[2][1] = 227
    $aArray[3][0] = 325
    $aArray[3][1] = 227+12
    $aArray[4][0] = 174
    $aArray[4][1] = 227+12
    _GDIPlus_GraphicsFillPolygon($hBufferContext,$aArray,$hBrush)
    _GDIPlus_GraphicsDrawString($hBufferContext,"Laden...",180,227,"Arial",8)
    EndIf
    _GDIPlus_GraphicsFillRect($hBufferContext,177,242,($i+1)/$iFrames*146,16,$hBrush)
    _GDIPlus_GraphicsDrawImage($hGrafik,$hBufferBitmap,0,0)
    Next
    For $i = 0 to 6
    _GDIPlus_BrushDispose($aBrush[$i])
    Next
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_PenDispose($hPen)
    GUICtrlSetState($hCMenue_Neu,64)
    GUICtrlSetState($hCMenue_Paste,64)
    Return $aBitmap
    EndFunc

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

    Func Zufallig()
    For $i = 0 to UBound($aBitmaps)-1
    _GDIPlus_BitmapDispose($aBitmaps[$i])
    Next
    $iStars = Random(500,3000,1)
    $iSeed = Random(1,1000000,1)
    $iRadius = Random(50,200,1)
    $aBitmaps = Create($iFrames,$iStars,$iSeed,$iRadius)
    EndFunc

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

    Func Neu()
    Opt("GUIOnEventMode",0)
    Local $hGUI2 = GUICreate("Neu",300,124,-1,-1)
    GUICtrlCreateLabel("Seed:",0,12,100,19,2)
    Local $hInput_Seed = GUICtrlCreateInput($iSeed,110,10,150,19,1)
    GUICtrlCreateLabel("Frames:",0,32,100,19,2)
    Local $hInput_Frames = GUICtrlCreateInput($iFrames,110,30,150,19,1)
    GUICtrlCreateLabel("Sterne:",0,52,100,19,2)
    Local $hInput_Stars = GUICtrlCreateInput($iStars,110,50,150,19,1)
    GUICtrlCreateLabel("Radius:",0,72,100,19,2)
    Local $hInput_Radius = GUICtrlCreateInput($iRadius,110,70,150,19,1)
    Local $hButton_Ok = GUICtrlCreateButton("Erstellen",100,95,100,22)
    GUISetState(1,$hGUI2)
    Do
    $msg = GUIGetMsg()
    sleep(25)
    If $msg = -3 Then
    Opt("GUIOnEventMode",1)
    GUIDelete($hGUI2)
    Return
    EndIf
    Until $msg = $hButton_Ok
    Opt("GUIOnEventMode",1)
    $iSeed = GUICtrlRead($hInput_Seed)
    If StringRegExp($iSeed,"[^0-9]") Then $iSeed = Int(StringToBinary($iSeed))
    $iFrames = GUICtrlRead($hInput_Frames)
    $iStars = GUICtrlRead($hInput_Stars)
    $iRadius = GUICtrlRead($hInput_Radius)
    GUIDelete($hGUI2)
    For $i = 0 to UBound($aBitmaps)-1
    _GDIPlus_BitmapDispose($aBitmaps[$i])
    Next
    $aBitmaps = Create($iFrames,$iStars,$iSeed,$iRadius)
    EndFunc

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

    Func FPS_05()
    $iFPS = 5
    EndFunc

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

    Func FPS_10()
    $iFPS = 10
    EndFunc

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

    Func FPS_15()
    $iFPS = 15
    EndFunc

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

    Func FPS_20()
    $iFPS = 20
    EndFunc

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

    Func FPS_25()
    $iFPS = 25
    EndFunc

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

    Func FPS_30()
    $iFPS = 30
    EndFunc

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

    Func FPS_()
    Local $iNewFPS = InputBox("Bildrate","",$iFPS)
    If @error > 0 Then Return
    $iNewFPS = Int($iNewFPS)
    If $iNewFPS <= 0 Then
    Msgbox(16,"Fehler","Der Eingabewert muss über 0 sein")
    Else
    $iFPS = $iNewFPS
    EndIf
    EndFunc

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

    Func Copy()
    ClipPut(String($iSeed)&"+"&String($iFrames)&"+"&String($iStars)&"+"&String($iRadius))
    EndFunc

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

    Func Paste()
    Local $aArray = StringSplit(ClipGet(),"+")
    If Not IsArray($aArray) or $aArray[0] <> 4 Then
    msgbox(16,"Fehler","String konnte nicht eigefügt werden")
    Return
    EndIf
    $iSeed = Int($aArray[1])
    $iFrames = Int($aArray[2])
    $iStars = Int($aArray[3])
    $iRadius = Int($aArray[4])
    For $i = 0 to UBound($aBitmaps)-1
    _GDIPlus_BitmapDispose($aBitmaps[$i])
    Next
    $aBitmaps = Create($iFrames,$iStars,$iSeed,$iRadius)
    EndFunc

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

    Func _Exit()
    For $i = 0 to UBound($aBitmaps)-1
    _GDIPlus_BitmapDispose($aBitmaps[$i])
    Next
    _GDIPlus_GraphicsDispose($hBufferContext)
    _GDIPlus_BitmapDispose($hBufferBitmap)
    _GDIPlus_GraphicsDispose($hGrafik)
    _GDIPlus_Shutdown()
    exit
    EndFunc

    [/autoit]


    Dies ist einfach nur eine grafische Spielerei, welche ich heute nebenbei geschrieben habe.
    Wenn man das Script startet einfach einen Moment warten bis es fertig geladen hat.

    Über das Kontextmenü(Rechtsklick) bekommt man folgende Optionen:

    [Neu]
    Lädt eine neue Grafik mit zufälligen oder festgelegten Daten.

    [Bildrate]
    Über dieses Menü stellt man ein wie oft die Bilder pro Sekunde gewechselt werden.

    [Kopieren]
    Kopiert einen String aus welchem die Grafik Rekonstruiert werden kann.

    [Einfügen]
    Rekonstruiert anhand des durch [Kopieren] erhaltenen Strings eine Grafik

    Und wenn jemand gute Seeds findet, könnte wir sie ja hier auch sammeln, dann geht der Thred auch hoffentlich nicht so schnell unter^^


    Interessante Seeds


    ;---------------------------------------------------------------
    Seed: AutoIt
    Sterne: 500 - 1000
    Radius: 151
    Code: 127858751337793+150+1000+151


    ;----------------{Xorianator-Flügel }-------------------------
    Autor: Xorianator
    Seed: 881111141059711097116111114
    Sterne: 1000
    Radius: 150
    Code: 881111141059711097116111114+150+1000+150


    ;-------------------------------------------------------------------
    Autor: Xorianator
    Seed:
    66928340
    Sterne: 2513
    Radius: 164
    Code: 66928340+150+2513+164


    ;-------------------------------------------------------------------
    Autor: Xorianator
    Seed: 20348746193
    Sterne: 2513
    Radius: 164
    Code: 20348746193+150+2513+164


    ;-------------------------------------------------------------------
    Autor: James1337
    Seed: 477907
    Sterne: 2513
    Radius: 164
    Code: 477907+150+2513+164


    ;-------------------------------------------------------------------
    Autor: James1337
    Seed: 204327
    Sterne: 1108
    Radius: 140
    Code: 204327+150+1108+140


    ;--------------------------{ enormis }---------------------------
    Autor:
    chesstiger
    Seed: 845034036
    Sterne: 1108
    Radius: 140
    Code:
    845034036+150+1108+140


    ;-------------------------------------------------------------------
    Autor: chesstiger
    Seed: 9223372036854775807
    Sterne: 1405
    Radius: 195
    Code: 9223372036854775807+150+1405+195


    [Edit:] Ich schreib einfach mal alle Seeds die hier gepostet werden in den Spoiler

    5 Mal editiert, zuletzt von Zeitriss (10. August 2012 um 20:30)

  • Das is ma wieder ein geiles Script !
    €: Wie fügt man den Seed usw ein 0.0 ?
    $iSeed = "AutoIt" usw aber da kommt nur ein Punkt :o
    €2: "String konnte nicht eingefügt werden"

    Es gibt sehr viele Leute, die glauben. Aber aus Aberglauben.
    - Blaise Pascal

  • Hi,
    sehr fein :thumbup:

    Beim ersten Start hatte ich einen wirklich tollen "Spiralnebel", der sich leider bisher nicht wiederholt hat, ich werde einfach mal das Script nach "guten" Seeds suchen lassen und diese dann rotieren lassen ;)

  • Angesichts meines Namens der "Xorianator-Flügel":
    881111141059711097116111114+150+1000+150
    Seed = Xorianator von ASCII zu Nummern ;D

    Es gibt sehr viele Leute, die glauben. Aber aus Aberglauben.
    - Blaise Pascal

  • Also das passiert mir nicht oft in diesem Forum, aber ich bin wirklich überwältigt! Gute Arbeit! :thumbup:

    @Matthias Sieht echt gut aus, wow.

    MfG, James C.

    Edit:

    Code
    477907+150+2513+164
    204327+150+1108+140
    4537+150+920+131
    311373+150+1000+150
    15541833941070125+150+1000+150
    657851+150+1391+175
    173777+150+2692+130
    805841+150+1133+133
    21879+150+2000+150
    466711+150+2818+67
  • Noch ein Hammer seed:
    Global $iStars = 2513
    Global $iRadius = 164

    Global $iSeed = 66928340
    Global $iSeed = 20348746193

    Es gibt sehr viele Leute, die glauben. Aber aus Aberglauben.
    - Blaise Pascal

  • Xorianator:

    Vielen dank für die vielen Seeds. Ich hab sie oben in den Spoiler gepackt damit sie sich jeder ansehen kann.

    Wegen des Problem mit "AutoIt" als Seed
    Wenn du AutoIt eingibst kommt ein Punkt weil du es direkt im Code geändert hast und dem Script so die Möglichkeit genommen hast das Wort in eine Zahl umzuwandeln.
    Da er jetzt einen String als Seed hat rechnet AutoIt mit 0 und dass klappt nicht.
    Benütze lieber die Eingabefunktion unter "Rechtsklick>>Neu>>Neu"

    @James1337:

    Danke wie du sehen kannst habe ich deine Seeds aufgenommen. :thumbup:

    @Name22/UEZ:

    Ego += 20 8)

    Andy:

    Würde mich sehr freuen wenn du die "guten" Seeds Posten könntest falls du welche findest. :D

    Einmal editiert, zuletzt von Zeitriss (10. August 2012 um 19:52)

  • Das Forum hat ein neues Spielzeug entdeckt ;D
    @chess coole Seeds :)
    Der 2te ähnelt meinem sehr stark, vllt ist ja eine max-Länge mit meinem Seed überschritten :o - Auf alle Fälle cool ;D

    UEZ - Der Triple-Haken :D

    Es gibt sehr viele Leute, die glauben. Aber aus Aberglauben.
    - Blaise Pascal

  • Sieht interessant aus.
    Vorallem wenn man eine Hohe Framerate (25) und viele einzelbilder (500+) nimmt.


    Edit:
    Hab mal daran herumgebastelt (nur minimal).
    - Smoothing auf 2
    - Es werden jetzt Kreise mit variablem Durchmesser zentriert mit float Koordinaten gezeichnet statt kleine Rechtecke mit Int Koordinaten.

    Effekt: Es glitzert jetzt total ^^

    Spoiler anzeigen
    [autoit]


    Global $iFrames = 150
    Global $iFPS = 20
    Global $iStars = Random(500,3000,1)
    Global $iSeed = Random(1,1000000,1)
    Global $iRadius = Random(50,200,1)
    Opt("GUIOnEventMode",1)
    Local Const $iRtoD = ACos(-1)/180
    #include<GDIPlus.au3>
    _GDIPlus_Startup()
    Local $hGUI = GUICreate("Grafik User Interface",500,500,-1,-1)
    GUISetOnEvent(-3,"_exit",$hGUI)
    $hCMenue = GUICtrlCreateContextMenu()
    $hCMenue_Neu = GUICtrlCreateMenu("Neu",$hCMenue)
    $hCMenue_Neu_Neu = GUICtrlCreateMenuItem("Neu",$hCMenue_Neu)
    GUICtrlSetOnEvent($hCMenue_Neu_Neu,"Neu")
    $hCMenue_Neu_Zufaellig = GUICtrlCreateMenuItem("Zufällig",$hCMenue_Neu)
    GUICtrlSetOnEvent($hCMenue_Neu_Zufaellig,"Zufallig")
    $hCMenue_FPS = GUICtrlCreateMenu("Bildrate",$hCMenue)
    $hCMenue_FPS_5 = GUICtrlCreateMenuItem("5",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_5,"FPS_05")
    $hCMenue_FPS_10 = GUICtrlCreateMenuItem("10",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_10,"FPS_10")
    $hCMenue_FPS_15 = GUICtrlCreateMenuItem("15",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_15,"FPS_15")
    $hCMenue_FPS_20 = GUICtrlCreateMenuItem("20",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_20,"FPS_20")
    $hCMenue_FPS_25 = GUICtrlCreateMenuItem("25",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_25,"FPS_25")
    $hCMenue_FPS_30 = GUICtrlCreateMenuItem("30",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_30,"FPS_30")
    $hCMenue_FPS_Mehr = GUICtrlCreateMenuItem("Mehr...",$hCMenue_FPS)
    GUICtrlSetOnEvent($hCMenue_FPS_Mehr,"FPS_")
    $hCMenue_Copy = GUICtrlCreateMenuItem("Kopieren",$hCMenue)
    GUICtrlSetOnEvent($hCMenue_Copy,"Copy")
    $hCMenue_Paste = GUICtrlCreateMenuItem("Einfügen",$hCMenue)
    GUICtrlSetOnEvent($hCMenue_Paste,"Paste")
    Local $hGrafik = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    Local $hBufferBitmap = _GDIPlus_BitmapCreateFromGraphics(500,500,$hGrafik)
    Local $hBufferContext = _GDIPlus_ImageGetGraphicsContext($hBufferBitmap)
    GUISetState(1,$hGUI)
    Global $aBitmaps = Create($iFrames,$iStars,$iSeed,$iRadius)

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

    Local $iTimer = TimerInit()
    Local $iFrame = 0
    Do
    $iFrame = Mod(Timerdiff($iTimer)/(1000/$iFPS),$iFrames)
    _GDIPlus_GraphicsDrawImage($hGrafik,$aBitmaps[$iFrame],0,0)

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

    Until 0

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

    Func Create($iFrames,$iStars,$iSeed,$iRadius)
    GUICtrlSetState($hCMenue_Neu,128)
    GUICtrlSetState($hCMenue_Paste,128)
    Local $iSSeed = 0, $iDistanz = 0, $iWinkel = 0,$iTife = 0, $iFarbe = 0, $hContext = 0x00
    Local $aBrush[7]
    Local $aBitmap[$iFrames]
    Local $nD
    ;~ ConsoleWrite($nD & @CRLF)

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

    $aBrush[0] = _GDIPlus_BrushCreateSolid(0x999999FF)
    $aBrush[1] = _GDIPlus_BrushCreateSolid(0x99FFFF99)
    $aBrush[2] = _GDIPlus_BrushCreateSolid(0x99FFFFFF)
    $aBrush[3] = _GDIPlus_BrushCreateSolid(0x99FF9999)
    $aBrush[4] = _GDIPlus_BrushCreateSolid(0xFFFF9999)
    $aBrush[5] = _GDIPlus_BrushCreateSolid(0x99FF4444)
    $aBrush[6] = _GDIPlus_BrushCreateSolid(0xFF774444)

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

    If $iSeed = 4474194 Then
    $hBrush = _GDIPlus_BrushCreateSolid(0x88FF0000)
    Else
    $hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    EndIf
    $hPen = _GDIPlus_PenCreate(0xFFFFFFFF,2)
    _GDIPlus_GraphicsClear($hBufferContext,0xFF000000)
    _GDIPlus_GraphicsClear($hGrafik,0xFF000000)

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

    Local $iSeed2 = Mod(Round($iSeed,2),ACos(-1))*(100/ACos(-1))
    For $i = 0 to $iFrames-1
    $aBitmap[$i] = _GDIPlus_BitmapCreateFromGraphics(500,500,$hGrafik)
    $hContext = _GDIPlus_ImageGetGraphicsContext($aBitmap[$i])
    _GDIPlus_GraphicsSetSmoothingMode($hContext, 2)
    _GDIPlus_GraphicsClear($hContext,0xFF000000)
    For $ii = 1 to $iStars
    $iSSeed = $iSeed2*$ii
    $iDistanz = Mod($iSSeed,1)*$iRadius
    $iWinkel = Mod(Mod($iSSeed,0.36)*1000 + ($i+1)/$iFrames*360,360)
    $iTife = (Mod($iSSeed,0.5)-0.25)*Mod($iSSeed,100);$iSSeed/100
    If $iSeed = 4474194 Then
    $iFarbe = Int($iDistanz / $iRadius*2)+5
    Else
    $iFarbe = Int($iDistanz / $iRadius*5)
    EndIf
    $nD = _RandomMin(1, 3)
    _GDIPlus_GraphicsFillEllipseF($hContext,250 + Sin($iRtoD*$iWinkel)*$iDistanz-$nD/2,250 + Cos($iRtoD*$iWinkel)*$iDistanz*0.50 + $iTife-$nD/2,$nD,$nD,$aBrush[$iFarbe])
    Next
    _GDIPlus_GraphicsDispose($hContext)
    If $i = 0 Then
    _GDIPlus_GraphicsDrawImage($hBufferContext,$aBitmap[0],0,0)
    _GDIPlus_GraphicsDrawRect($hBufferContext,175,240,150,20,$hPen)
    Local $aArray[5][2] = [[4]]
    $aArray[1][0] = 174
    $aArray[1][1] = 227
    $aArray[2][0] = 190+30
    $aArray[2][1] = 227
    $aArray[3][0] = 325
    $aArray[3][1] = 227+12
    $aArray[4][0] = 174
    $aArray[4][1] = 227+12
    _GDIPlus_GraphicsFillPolygon($hBufferContext,$aArray,$hBrush)
    _GDIPlus_GraphicsDrawString($hBufferContext,"Laden...",180,227,"Arial",8)
    EndIf
    _GDIPlus_GraphicsFillRect($hBufferContext,177,242,($i+1)/$iFrames*146,16,$hBrush)
    _GDIPlus_GraphicsDrawImage($hGrafik,$hBufferBitmap,0,0)
    Next
    For $i = 0 to 6
    _GDIPlus_BrushDispose($aBrush[$i])
    Next
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_PenDispose($hPen)
    GUICtrlSetState($hCMenue_Neu,64)
    GUICtrlSetState($hCMenue_Paste,64)
    Return $aBitmap
    EndFunc

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

    Func _RandomMin($Min, $Max) ; Tendenz zum kleinst möglichen Wert
    Return Random($Min, Random($Min, Random($Min, Random($Min, $Max))))
    EndFunc

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

    Func _GDIPlus_GraphicsFillEllipseF($hGFX, $x, $y, $w, $h, $b)
    DllCall($ghGDIPDll, "int", "GdipFillEllipse", "handle", $hGFX, "handle", $b, "float", $X, "float", $Y, "float", $W, "float", $H)
    EndFunc

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

    Func Zufallig()
    For $i = 0 to UBound($aBitmaps)-1
    _GDIPlus_BitmapDispose($aBitmaps[$i])
    Next
    $iStars = Random(500,3000,1)
    $iSeed = Random(1,1000000,1)
    $iRadius = Random(50,200,1)
    $aBitmaps = Create($iFrames,$iStars,$iSeed,$iRadius)
    EndFunc

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

    Func Neu()
    Opt("GUIOnEventMode",0)
    Local $hGUI2 = GUICreate("Neu",300,124,-1,-1)
    GUICtrlCreateLabel("Seed:",0,12,100,19,2)
    Local $hInput_Seed = GUICtrlCreateInput($iSeed,110,10,150,19,1)
    GUICtrlCreateLabel("Frames:",0,32,100,19,2)
    Local $hInput_Frames = GUICtrlCreateInput($iFrames,110,30,150,19,1)
    GUICtrlCreateLabel("Sterne:",0,52,100,19,2)
    Local $hInput_Stars = GUICtrlCreateInput($iStars,110,50,150,19,1)
    GUICtrlCreateLabel("Radius:",0,72,100,19,2)
    Local $hInput_Radius = GUICtrlCreateInput($iRadius,110,70,150,19,1)
    Local $hButton_Ok = GUICtrlCreateButton("Erstellen",100,95,100,22)
    GUISetState(1,$hGUI2)
    Do
    $msg = GUIGetMsg()
    sleep(25)
    If $msg = -3 Then
    Opt("GUIOnEventMode",1)
    GUIDelete($hGUI2)
    Return
    EndIf
    Until $msg = $hButton_Ok
    Opt("GUIOnEventMode",1)
    $iSeed = GUICtrlRead($hInput_Seed)
    If StringRegExp($iSeed,"[^0-9]") Then $iSeed = Int(StringToBinary($iSeed))
    $iFrames = GUICtrlRead($hInput_Frames)
    $iStars = GUICtrlRead($hInput_Stars)
    $iRadius = GUICtrlRead($hInput_Radius)
    GUIDelete($hGUI2)
    For $i = 0 to UBound($aBitmaps)-1
    _GDIPlus_BitmapDispose($aBitmaps[$i])
    Next
    $aBitmaps = Create($iFrames,$iStars,$iSeed,$iRadius)
    EndFunc

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

    Func FPS_05()
    $iFPS = 5
    EndFunc

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

    Func FPS_10()
    $iFPS = 10
    EndFunc

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

    Func FPS_15()
    $iFPS = 15
    EndFunc

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

    Func FPS_20()
    $iFPS = 20
    EndFunc

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

    Func FPS_25()
    $iFPS = 25
    EndFunc

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

    Func FPS_30()
    $iFPS = 30
    EndFunc

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

    Func FPS_()
    Local $iNewFPS = InputBox("Bildrate","",$iFPS)
    If @error > 0 Then Return
    $iNewFPS = Int($iNewFPS)
    If $iNewFPS <= 0 Then
    Msgbox(16,"Fehler","Der Eingabewert muss über 0 sein")
    Else
    $iFPS = $iNewFPS
    EndIf
    EndFunc

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

    Func Copy()
    ClipPut(String($iSeed)&"+"&String($iFrames)&"+"&String($iStars)&"+"&String($iRadius))
    EndFunc

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

    Func Paste()
    Local $aArray = StringSplit(ClipGet(),"+")
    If Not IsArray($aArray) or $aArray[0] <> 4 Then
    msgbox(16,"Fehler","String konnte nicht eigefügt werden")
    Return
    EndIf
    $iSeed = Int($aArray[1])
    $iFrames = Int($aArray[2])
    $iStars = Int($aArray[3])
    $iRadius = Int($aArray[4])
    For $i = 0 to UBound($aBitmaps)-1
    _GDIPlus_BitmapDispose($aBitmaps[$i])
    Next
    $aBitmaps = Create($iFrames,$iStars,$iSeed,$iRadius)
    EndFunc

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

    Func _Exit()
    For $i = 0 to UBound($aBitmaps)-1
    _GDIPlus_BitmapDispose($aBitmaps[$i])
    Next
    _GDIPlus_GraphicsDispose($hBufferContext)
    _GDIPlus_BitmapDispose($hBufferBitmap)
    _GDIPlus_GraphicsDispose($hGrafik)
    _GDIPlus_Shutdown()
    exit
    EndFunc

    [/autoit]
  • Hi,

    gefällt mir auch sehr. Schöne Idee, dass man selbst was einstellen kann und es somit zum experimentieren anregt! :thumbup:

    Habe einfach mal was eingegeben, sieht auch irgendwie ganz lustig aus (erinnert wenn auch minimal an einen PC-Lüfter):

    Code: 2012+110+2100+210

  • @Xor: Hast im Prinzip Recht.
    Ich mag es halt nicht, wenn wirklich gute Ideen nicht völlig ausgebaut werden.
    Und da habe ich einen (kleinen) Schritt gewagt...