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

  • Revision Demoparty 2014 Streams'n'Tools (und allgemeine Demoparty Diskussion)

    • UEZ
    • 27. April 2014 um 18:47
    Zitat von minx

    Ich habe nur noch mehrere noch unleserliche Versionen.

    Das ist aber schade, denn es ist die Hölle eine kleinere Auflösung zu wählen und den puristischen Code anzupassen, ohne Hintergrundwissen. :(

    Gruß,
    UEZ

  • Revision Demoparty 2014 Streams'n'Tools (und allgemeine Demoparty Diskussion)

    • UEZ
    • 27. April 2014 um 18:22

    minx: hast du gerreg.au3 auch in einer leserlichen Version da?

    Cooles Ding. 8o:thumbup:

    Jetzt würde mich noch die Erklärungen der einzelnen "Chapters" interessieren.

    Und was ist Kodek?

    Gruß,
    UEZ

  • Revision Demoparty 2014 Streams'n'Tools (und allgemeine Demoparty Diskussion)

    • UEZ
    • 26. April 2014 um 22:14

    Hier die Portierung des Diamond-Square Algorithmuses von C#.

    Spoiler anzeigen
    [autoit]


    ;http://en.wikipedia.org/wiki/Diamond-square_algorithm
    ;converted from http://www.smokycogs.com/blog/plasma-fractals/
    #include <GDIPlus.au3>

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

    _GDIPlus_Startup()
    Global $iW = 512, $iH = 512, $bPreview = False, $f = ($iW > $iH) ? $iW / $iH : $iH / $iW, $iRecursion = 0, $fPerc
    Global $hGUI = GUICreate("Cloud Generator using Diamond-Square Algorithm", $iW, $iH, -1, -1)
    Global $iPic = GUICtrlCreatePic("", 0, 0, $iW, $iH)
    Global $iLabel = GUICtrlCreateLabel("Please wait...", 1, $iH - 12, $iW, 12)
    GUICtrlSetBkColor(-1, -2)
    GUISetState()

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

    Global $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH), $hBmp_GDI
    AdlibRegister("Show_Perc", 250)
    Local $s, $t = TimerInit()
    Generate($iW, $iH, 3)
    $s = TimerDiff($t)
    AdlibUnRegister("Show_Perc")
    ConsoleWrite($s & " ms / Recursion calls: " & $iRecursion & " / Pixels set: " & $iW * $iH & " / Speed: ~" & Round($iW * $iH / $s * 1000, 2) & " px/s" & @CRLF)
    $hBmp_GDI = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, 0x0172, 0x0000, $hBmp_GDI))
    _WinAPI_DeleteObject($hBmp_GDI)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_Shutdown()

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

    Do
    Until GUIGetMsg() = -3

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

    Func Show_Perc()
    GUICtrlSetData($iLabel, "Please wait..." & (StringFormat("%.2f %", $iRecursion / ($f * ($iW * $iH) / 3) * 100)))
    EndFunc

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

    Func DivideGrid($x, $y, $width, $height, $c1, $c2, $c3, $c4, $gBigSize, $gRoughness)
    Local $Edge1, $Edge2, $Edge3, $Edge4, $Middle
    Local $newWidth = $width / 2
    Local $newHeight = $height / 2
    If ($width > 1) Or ($height > 1) Then
    $iRecursion += 1
    $Middle = (($c1 + $c2 + $c3 + $c4) / 4) + Displace($newWidth + $newHeight, $gBigSize, $gRoughness); Randomly displace the midpoint!
    $Edge1 = (($c1 + $c2) / 2) ; Calculate the edges by averaging the two corners of each edge.
    $Edge2 = (($c2 + $c3) / 2) ;
    $Edge3 = (($c3 + $c4) / 2) ;
    $Edge4 = (($c4 + $c1) / 2) ;
    ;Make sure that the midpoint doesn't accidentally "randomly displaced" past the boundaries!
    $Middle= Rectify($Middle) ;
    $Edge1 = Rectify($Edge1) ;
    $Edge2 = Rectify($Edge2) ;
    $Edge3 = Rectify($Edge3) ;
    $Edge4 = Rectify($Edge4) ;
    ;Do the operation over again for each of the four new grids.
    DivideGrid($x, $y, $newWidth, $newHeight, $c1, $Edge1, $Middle, $Edge4, $gBigSize, $gRoughness);
    DivideGrid($x + $newWidth, $y, $width - $newWidth, $newHeight, $Edge1, $c2, $Edge2, $Middle, $gBigSize, $gRoughness);
    DivideGrid($x + $newWidth, $y + $newHeight, $width - $newWidth, $height - $newHeight, $Middle, $Edge2, $c3, $Edge3, $gBigSize, $gRoughness);
    DivideGrid($x, $y + $newHeight, $newWidth, $height - $newHeight, $Edge4, $Middle, $Edge3, $c4, $gBigSize, $gRoughness);
    Else ; This is the "base case," where each grid piece is less than the size of a pixel.
    ; The four corners of the grid piece will be averaged and drawn as a single pixel.
    Local $c = ($c1 + $c2 + $c3 + $c4) / 4
    Local $r = Int(0xFF - 0xFF * $c), $g = Int(0xFF - 0xFF * $c), $b = Int(0xFF - 0xFF * $c / 2)
    Local $color = "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2)
    DllCall($ghGDIPDll, "int", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $x, "int", $y, "uint", $color)
    ;~ _GDIPlus_BitmapSetPixel($hBitmap, $x, $y, $color)
    If ($width = 2) Then
    DllCall($ghGDIPDll, "int", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $x + 1, "int", $y, "uint", $color)
    ;~ _GDIPlus_BitmapSetPixel($hBitmap, $x + 1, $y, $color)
    ElseIf ($height = 2) Then
    DllCall($ghGDIPDll, "int", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $x, "int", $y + 1, "uint", $color)
    ;~ _GDIPlus_BitmapSetPixel($hBitmap, $x, $y + 1, $color)
    ElseIf ($width = 2) And ($height = 2) Then
    DllCall($ghGDIPDll, "int", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $x + 1, "int", $y + 1, "uint", $color)
    ;~ _GDIPlus_BitmapSetPixel($hBitmap, $x + 1, $y + 1, $color)
    EndIf
    If $bPreview Then
    $hBmp_GDI = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, 0x0172, 0x0000, $hBmp_GDI))
    _WinAPI_DeleteObject($hBmp_GDI)
    EndIf
    EndIf
    EndFunc

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

    Func Generate($iWidth, $iHeight, $iRoughness)
    DivideGrid(0, 0, $iWidth, $iHeight, Random(0, 0.99999), Random(0, 0.99999), Random(0, 0.99999), Random(0, 0.99999), $iWidth + $iHeight, $iRoughness)
    Return True
    EndFunc

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

    Func Rectify($iNum)
    If $iNum < 0 Then Return $iNum = 0
    If $iNum > 1 Then Return $iNum = 1
    ;~ $iNum = ($iNum < 0) ? 0 : $iNum
    ;~ $iNum = ($iNum > 1.0) ? 1 : $iNum
    Return $iNum
    EndFunc

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

    Func Displace($SmallSize, $gBigSize, $gRoughness)
    Return (Random(0, 1) - 0.5) * $SmallSize / $gBigSize * $gRoughness
    EndFunc

    [/autoit]

    Hier kann man schön die Grenzen von AutoIt sehen, was die Geschwindigkeit angeht. Mein Notebook schaft ca. 15000 Pixels pro Sekunde.

    Gruß,
    UEZ

  • Revision Demoparty 2014 Streams'n'Tools (und allgemeine Demoparty Diskussion)

    • UEZ
    • 25. April 2014 um 09:27

    Die Szene ist eigentlich eine fast "brotlose Kunst". Wenn ich mir z.B. die 64kb Gewinner Demo anschauen, dann ziehe ich den Hut!.

    Mercury 64kb winner @ revision 2014

    So was in 64kb unterzubringen ist echte Kunst, mal ganz abgesehen von den Programmierkünsten. Oder die 8kb Demo von Loonies ist auch beeindruckend! ->The Bridge


    PC Demo Sieger cocoon: Observatory

    Gruß,
    UEZ

  • Entpacken von mehreren Zip Files an verschiedene Orte

    • UEZ
    • 23. April 2014 um 20:32

    Du kannst auch die Windows API dazu benutzen: http://www.autoitscript.com/forum/topic/11…fldrdll-library

    Gruß,
    UEZ

  • Revision Demoparty 2014 Streams'n'Tools (und allgemeine Demoparty Diskussion)

    • UEZ
    • 20. April 2014 um 21:47

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

    :rock::party:

    exklusiv von der party (ihr müsst euch auf den Kopf stellen). ;)


    Bauzaun:

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

    grüße andy und uez

    Dateien

    20140420_205057.jpg 340,42 kB – 0 Downloads 20140421_010906[1].jpg 1,18 MB – 0 Downloads
  • Admin-Geburtstag

    • UEZ
    • 18. April 2014 um 18:46

    Alles Gute zum 33.

    Gruß,
    UEZ

  • Grafik speichern - nur schwarzes Bild oder gar kein Ergebnis

    • UEZ
    • 12. April 2014 um 19:20

    In der aktuellen AutoIt sollten die GDI+ Funktionen beschrieben sein.

    CreatBitmapFromScan0 erstellt einfach eine leere Bitmap, nicht mehr, nicht weniger.

    Gruß,
    UEZ

  • Grafik speichern - nur schwarzes Bild oder gar kein Ergebnis

    • UEZ
    • 11. April 2014 um 16:40

    Probiere es mal damit:

    Spoiler anzeigen
    [autoit]


    #include-once
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <ProgressConstants.au3>
    #include <ButtonConstants.au3>
    #include <GdiPlus.au3>
    #Include <Array.au3>
    #include <EditConstants.au3>

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

    ;~ #include <_GUIBox.au3>
    #include <Misc.au3>

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

    _GDIPlus_Startup() ;Gdi+ starten
    ;------------------------------------------------------------
    Global $vXs,$vXe,$vYs,$vYe,$vSpalte,$vZeile,$vStarX,$vEndX,$vStarY,$vEndY,$vDurchlauf,$vMaxDurchlauf,$vBereichX,$vBereichY,$vmI,$vmD
    Global $vBreiteGrafik, $vHoeheGrafik, $vStartGrafikX, $vStartGrafikY, $vSteppX, $vSteppY
    Global $Ratio1, $Ratio2, $Ratio3, $aMPos[4],$vRatio
    Global $vDisplayBreite, $vDisplayHoehe

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

    Global $nMsg,$hGraphic,$hPinsel,$vInteration,$aFarben[0],$vFarbanzahl,$vStop,$hBitmap,$hBuffer,$vStepp,$hKopie,$dc

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

    $user32 = DllOpen("user32.dll")
    $gdi32 = DllOpen("gdi32.dll")

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

    $vDisplayBreite=@DesktopWidth-20;
    $vDisplayHoehe=@DesktopHeight-20;
    $vStartGrafikX=10
    $vStartGrafikY=10

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

    $hWBild = GUICreate("Fraktal",$vDisplayBreite,$vDisplayHoehe-20, -1, 0)
    $dc = GetDC(WinGetHandle($hWBild))
    $hBitmap_Save = _GDIPlus_BitmapCreateFromScan0($vDisplayBreite,$vDisplayHoehe-20)
    $hWDaten=GUICreate("FFP - Datenfenster",$vDisplayBreite,150,-1,@DesktopHeight-170,-1,-1,$hWBild)

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

    ; Eingabe der Eckdaten zur Berechnung
    GUICtrlCreateGroup("Werte für die X - und Y - Achse",5,4,236,113)
    GUICtrlCreateLabel("Startwert:",37,19)
    GUICtrlCreateLabel("Endwert:",140,19)
    GUICtrlCreateLabel("X:",12,39)
    $vStartX=GUICtrlCreateInput("-2.50", 28, 35, 100, 20)
    $vEndX=GUICtrlCreateInput("+1.00", 131, 35, 100, 20)
    GUICtrlCreateLabel("Y:",13,61)
    $vStartY=GUICtrlCreateInput("-1.40", 28, 58, 100, 20)
    $vEndY=GUICtrlCreateInput("+1.40", 131, 58, 100, 20)
    $lBreiteX_Achse=GUICtrlCreateLabel("Wert X-Achse: ",12,81,200,12)
    $lBreiteY_Achse=GUICtrlCreateLabel("Wert Y-Achse: ",12,97,200,12)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ; Gruppe schliessen
    ; Eingabe der Eckdaten zur Berechnung
    GUICtrlCreateGroup("",250,4,180,62)
    GUICtrlCreateLabel("max. Durchläufe:",275,19)
    $vMaxDurchlauf=GUICtrlCreateInput("100", 360, 17, 60, 20)
    GUICtrlCreateLabel("Höchstwert Iteration:",259,41)
    $vMaxIteration=GUICtrlCreateInput("1000", 360, 39, 60, 20)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ; Gruppe schliessen
    GUICtrlCreateGroup("Farbraster",250,70,180,39)
    GUICtrlCreateLabel("Faktor:",296,85)
    $vZoom=GUICtrlCreateInput("23", 360, 83, 60, 20)
    $updown = GUICtrlCreateUpdown($vZoom)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ; Gruppe schliessen
    ; Gruppe Grafikgröße in Pixel
    GUICtrlCreateGroup("Grafikgröße - waagerecht x senkrecht",440,4,200,62)
    $vInputBeiteGrafik=GUICtrlCreateInput($vDisplayBreite, 470, 30, 60, 20) ;$vDisplayBreite
    $vBeiteGrafikTMP=GUICtrlCreateUpdown($vInputBeiteGrafik)
    GUICtrlCreateLabel("X",537,31)
    $vInputHoeheGrafik=GUICtrlCreateInput($vDisplayHoehe, 550, 30, 60, 20)
    $vHoeheGrafikTMP=GUICtrlCreateUpdown($vInputHoeheGrafik)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ; Gruppe schliessen
    ; Gruppe Seitenverhältnis
    GUICtrlCreateGroup("Seitenverhältnis der Grafik",440,70,200,39)
    $bRatio1 = GUICtrlCreateRadio("4 : 3", 450, 85, 50, 20) ; = 0.75 oder 1.33333
    $bRatio2 = GUICtrlCreateRadio("16 : 9", 520, 85, 50, 20) ; = 0.5625 oder 1.777778
    $bRatio3 = GUICtrlCreateRadio("ohne", 590, 85, 45, 20)
    GUICtrlSetState($bRatio3, $GUI_CHECKED)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ; Gruppe schliessen
    ; ----------------------------------------------------------------------------
    GUICtrlCreateGroup("Auswahl der Farbpalette",650,4,130,105)
    $bPalette1 = GUICtrlCreateRadio("Farbpalette 1", 670, 30, 100, 20)
    $bPalette2 = GUICtrlCreateRadio("Farbpalette 2", 670, 52, 100, 20)
    $bPalette3 = GUICtrlCreateRadio("Farbpalette 3", 670, 74, 100, 20)
    GUICtrlSetState($bPalette1, $GUI_CHECKED)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ; Gruppe schliessen
    ; Gruppe Prozessbar
    $vGruppeProzess=GUICtrlCreateGroup("Fortschritt",$vDisplayBreite-220,79,210,30)
    $vProgressbar = GUICtrlCreateProgress($vDisplayBreite-216, 92, 200, 10, $PBS_SMOOTH)
    GUICtrlSetColor(-1, 32250)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ; Gruppe schliessen
    ; ------------------------------ Fußzeile ---------------------------------------------------

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

    ;----------------------------------------------------------------
    $bFoto=GUICtrlCreateButton("Bild speichern",$vDisplayBreite-220,8,100,20)
    $bStart=GUICtrlCreateButton("Start",$vDisplayBreite-110,35,100,40,$BS_DEFPUSHBUTTON)
    $bAbbrechen=GUICtrlCreateButton("Beenden",$vDisplayBreite-220,35,100,40)
    GUISetState(@SW_SHOW,$hWBild)
    WinActivate("Fraktal")
    GUISetBkColor(0X000000)
    GUISetState(@SW_SHOW,$hWDaten)

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

    GUISwitch($hWDaten)

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

    While 1
    ;~ $nMsg=GUIGetMsg()
    $aMsg = GUIGetMsg(1)
    If $aMsg[1]=$hWBild Then
    Switch $aMsg[0]
    Case $GUI_EVENT_PRIMARYDOWN
    ;~ $aRubberGBox=_GBoxCreate("",2,0xFF0000)
    $aMPos[0]=MouseGetPos(0)
    $aMPos[1]=MouseGetPos(1)
    while _IsPressed("01",$user32)
    $aMPos[2]=MouseGetPos(0)
    $aMPos[3]=MouseGetPos(1)
    ;~ MsgBox(0,"$vRatio",$vRatio)
    ;~ $aMPos[3]=$aMPos[1]+($aMPos[2]-$aMPos[0])*0.75

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

    ;~ $vRatioTMP=($aMPos[2]-$aMPos[0])*$vRatio
    ;~ ToolTip("Position: "&$aMPos[0]&"x"&$aMPos[1]&" - - "&$aMPos[2]&"x"&$aMPos[3]&" R: "&$vRatio)
    ;~ _GBoxShowAt($aRubberGBox,$aMPos[0],$aMPos[1],$aMPos[2],$aMPos[3])
    Sleep(10)
    WEnd
    KoordinatenNeu()
    ;~ _GBoxDestroy($aRubberGBox)
    EndSwitch
    ElseIf $aMsg[1]=$hWDaten Then
    Switch $aMsg[0]
    Case $bFoto
    Fraktal_speichern()
    Case $bStart ;46
    Start()
    Case $bAbbrechen
    Abbrechen()
    Case $bRatio1
    $vRatio=Verhaeltniss(1)
    Case $bRatio2
    $vRatio=Verhaeltniss(2)
    Case $bRatio3
    $vRatio=Verhaeltniss(3)
    EndSwitch
    EndIf
    WEnd

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

    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------
    Func Start()
    EingabeAuslesen()
    GUICtrlSetData($bStart,"STOP")
    GUICtrlSetBkColor($bStart,0x777777)
    GUICtrlSetData($lBreiteX_Achse,"Wert X-Achse: "&StringFormat("%.18f",$vBereichX))
    GUICtrlSetData($lBreiteY_Achse,"Wert Y-Achse: "&StringFormat("%.18f",$vBereichY))
    GUISetState(@SW_SHOW,$hWBild)
    WinActivate("Fraktal")
    GUISetBkColor(0X000000)
    GUISetState(@SW_SHOW,$hWDaten)

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

    FarbTab_anlegen($vStepp)
    HotKeySet("{ESC}","CheckMaus")
    WinSetTitle($hWDaten,"","FFP - Datenfenster - - - 'ESC' stopt die Berechnung")
    Modul1()
    EndFunc

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

    Func KoordinatenNeu()
    GUICtrlSetData($vStartX, $vXs+$vSteppX*($aMPos[0]-20))
    GUICtrlSetData($vEndX,$vXs+$vSteppX*($aMPos[2]-20))
    GUICtrlSetData($vStartY, $vYs+$vSteppY*($aMPos[1]-35))
    GUICtrlSetData($vEndY,$vYs+$vSteppY*($aMPos[3]-35))
    EndFunc

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

    Func Modul1() ;Formel Apfelbrot original

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

    $vBeginn=TimerInit()
    $vStop=0
    $vYi=$vYs
    ;~ MsgBox(0,"","Breite von "&$vStartGrafikX&" - "&$vBreiteGrafik+$vStartGrafikX)
    For $vZeile=$vStartGrafikY to $vHoeheGrafik ; Pixel auf Y-Achse durchtackern
    GUICtrlSetData($vProgressbar, $vZeile*100/($vHoeheGrafik))
    GUICtrlSetData($vGruppeProzess,"Berechnet: "&StringFormat("%.2f",$vZeile*100/($vHoeheGrafik))&"%")
    $vYi=$vYi+$vSteppY
    $vXi=$vXs
    For $vSpalte=$vStartGrafikX to $vBreiteGrafik ; Pixel auf der X-Achse
    $vXi=$vXi+$vSteppX
    ;Berechnung des Fraktals
    $vDurchlauf=0
    $vInteration=0
    $vXt=0
    $vYt=0
    $vP=0
    While $vP=0
    $vX_tmp=$vXt*$vXt-$vYt*$vYt+$vXi
    $vYt=2*$vXt*$vYt+$vYi
    $vXt=$vX_tmp
    $vDurchlauf+=1
    ;~ $vInteration=$vXt*$vXt+$vYt*$vYt
    If ($vXt*$vXt+$vYt*$vYt)>$vmI Or $vDurchlauf>$vmD Then ExitLoop
    WEnd
    setPixel($dc,$vSpalte,$vZeile,Farbwert($vDurchlauf,$vmD)) ; DLL Funktion
    if $vStop=1 Then
    $vSpalte=$vBreiteGrafik+$vStartGrafikX
    $vZeile=$vHoeheGrafik+$vStartGrafikY
    EndIf
    Next
    Next
    Fraktal_speichern()
    GUICtrlSetData($bStart,"Start")
    ;~ MsgBox(0,"Rechenzeit","Dauer: "&Minute(timerdiff($vBeginn)))
    EndFunc

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

    Func CheckMaus()
    ;~ Opt("GUIOnEventMode",0)
    $vStop=1
    WinSetTitle($hWDaten,"","FFP - Datenfenster - - - Mit 'ESC' Berechnung gestoppt !")
    GUICtrlSetData($bStart,"Start")
    EndFunc

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

    Func Fraktal_speichern()
    $vDateiName=@ScriptDir&"\Bilder\Test_1.jpg"
    ConsoleWrite($vDateiName)
    If _GDIPlus_ImageSaveToFile($hBitmap_Save,$vDateiName)Then ;Test: _"&@YEAR&@MON&@MDAY&"-"&@HOUR&":"&@MIN&":"&@SEC&"
    MsgBox(0,"Speichern ....","Bild wurde erfolgreich gespeichert !!! "&@error,3)
    Else
    MsgBox(0,"Error",@error)
    EndIf
    EndFunc

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

    Func Farbwert($vDurchlauf,$vmD)
    ;~ ConsoleWrite ("Farbe: "&$vColor&" - ")
    if $vDurchlauf>$vmD Then
    $vColor=0x000000
    Else
    $vColor="0x"&$aFarben[int(Int($vDurchlauf*100/$vmD)*($vFarbanzahl-1)/100)]
    EndIf
    Return $vColor
    EndFunc

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

    Func FarbTab_anlegen($vStepp)
    Switch $vStepp
    Case 1,2,4,8,16,32,64,128
    $vFarbanzahl=Int(256/$vStepp)^3
    Case Else
    $vFarbanzahl=Int(256/$vStepp+1)^3
    EndSwitch
    ToolTip("Generiere Farbtabelle mit "&$vFarbanzahl&"Farben")
    Dim $aFarben[$vFarbanzahl]
    ;~ ConsoleWrite("Array-Farbzahl: "&$vFarbanzahl&@CR&@CR)
    $vNr=0
    For $vR=0 To 255 Step $vStepp
    For $vG=0 To 255 Step $vStepp
    For $vB=0 To 255 Step $vStepp
    $aFarben[$vNr]=Hex($vR,2)&Hex($vG,2)&Hex($vB,2)
    $vNr+=1
    Next
    Next
    Next
    ToolTip("")
    ;~ _ArrayDisplay($aFarben)
    EndFunc

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

    Func Abbrechen()
    ;~ _GDIPlus_BrushDispose($hPinsel)
    ;~ _GDIPlus_PenDispose($hPinsel)
    _GDIPlus_BitmapDispose($hBitmap_Save)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_GraphicsDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hKopie)
    _GDIPlus_GraphicsDispose($hBuffer)
    _GDIPlus_Shutdown()
    DllClose($user32)
    DllClose($gdi32)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

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

    Func Verhaeltniss($vRatio)
    Select
    Case $vRatio=1
    GUICtrlSetStyle($vInputHoeheGrafik,$ES_READONLY)
    GUICtrlSetData($vInputHoeheGrafik,int(StringReplace(GUICtrlRead($vInputBeiteGrafik),".","")/4*3))
    $vRatio=1/4*3
    Case $vRatio=2
    GUICtrlSetStyle($vInputHoeheGrafik,$ES_READONLY)
    GUICtrlSetData($vInputHoeheGrafik,int(StringReplace(GUICtrlRead($vInputBeiteGrafik),".","")/16*9))
    $vRatio=1/16*9
    ; Code folgt noch
    Case $vRatio=3
    GUICtrlSetStyle($vInputHoeheGrafik,$GUI_SS_DEFAULT_INPUT)
    $vRatio=1/GUICtrlRead($vInputBeiteGrafik)*GUICtrlRead($vInputHoeheGrafik)
    EndSelect
    ;~
    Return $vRatio
    EndFunc

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

    Func EingabeAuslesen()
    $vXs=GUICtrlRead($vStartX) ;Startwert für X
    $vXe=GUICtrlRead($vEndX) ;Endwert für X
    $vYs=GUICtrlRead($vStartY) ;Startwert für Y
    $vYe=GUICtrlRead($vEndY) ;Endwert für Y
    $vmD=GUICtrlRead($vMaxDurchlauf) ;maxAnzahl der Dürchläufe
    $vmI=GUICtrlRead($vMaxIteration) ;MaxWert Iteration
    $vStepp=GUICtrlRead($vZoom) ;Farbfaktor auslesen
    $vBreiteGrafik=GUICtrlRead($vInputBeiteGrafik) ; Grafikbreite auslesen
    $vHoeheGrafik=GUICtrlRead($vInputHoeheGrafik) ;Grafikhöhe auslesen
    $vPalette1=BitAND(GUICtrlRead($bPalette1), $GUI_CHECKED) ;Wleche Palette ist aktiv
    $vPalette2=BitAND(GUICtrlRead($bPalette2), $GUI_CHECKED)
    $vPalette3=BitAND(GUICtrlRead($bPalette3), $GUI_CHECKED)
    ; Wertebereich ermitteln
    If $vXs<0 and $vXe<0 Then $vBereichX=($vXs+$vXe*-1)*-1
    If $vXs<0 and $vXe>0 Then $vBereichX=$vXs*-1+$vXe
    If $vXs>0 and $vXe>0 Then $vBereichX=$vXe-$vXs
    If $vYs<0 and $vYe<0 Then $vBereichY=($vYs+$vYe*-1)*-1
    If $vYs<0 and $vYe>0 Then $vBereichY=$vYs*-1+$vYe
    If $vYs>0 and $vYe>0 Then $vBereichY=$vYe-$vYs
    $vSteppX=$vBereichX/$vBreiteGrafik ;Schritweite für X errechnen
    $vSteppY=$vBereichY/$vHoeheGrafik ;Schritweite für Y errechnen
    EndFunc

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

    Func setpixel($dc, $x, $y, $color) ;pixel mit farbe an koordinaten setzen
    DllCall($gdi32, "long", "SetPixel", "long", $dc, "long", $x, "long", $y, "long", $color)
    _GDIPlus_BitmapSetPixel($hBitmap_Save, $x, $y, 0xFF000000 + $color)
    EndFunc ;==>pix

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

    Func GetDC($handle)
    $dc = DllCall($user32, "int", "GetDC", "hwnd", $handle)
    Return $dc[0]
    EndFunc ;==>GetDC

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

    Func Minute($zLZ)
    $tM=-1
    $th=-1
    $zLZ=int($zLZ/1000)
    for $tI=$zLZ to 0 step -60 ;Minuten ausrechnen
    $tM+=1
    Next
    If $tM>59 Then
    for $tI=$tM to 0 step -60 ;Stunden ausrechnen
    $th+=1
    Next
    EndIf
    If $tM<1 Then
    $zLZ=$zLZ&" Sekunden"
    ElseIf $tM>=1 And $th<1 Then
    $zLZ=$tM&"."&StringFormat("%02s",$zLZ-$tM*60)&" Minuten"
    ElseIf $tM>=1 And $th>=1 Then
    $zLZ=$th&"."&$tM-$th*60&"."&StringFormat("%02s",$zLZ-$tM*60)&" Stunden"
    EndIf
    Return $zLZ
    EndFunc

    [/autoit]

    Ich habe die Funktionen aus _GUIBox.au3 auskommentiert...


    Gruß,
    UEZ

  • Grafik speichern - nur schwarzes Bild oder gar kein Ergebnis

    • UEZ
    • 11. April 2014 um 14:26

    Ein nicht lauffähiges Skript ist nicht besonders hilfreich, aber hier einige Hinweise:

    _GDIPlus_GraphicsDrawRect($hGraphic, $aMPos[0], $aMPos[1],MouseGetPos(0)-$aMPos[0],MouseGetPos(1)-$aMPos[1],$hPinsel) schreibt direkt in den Graphic Handle und nicht in die Bitmap, somit bekommst du "nur" leere Bitmaps. D.h. du musst ein Graphic Context erstellen und deine Graphic Operationen in den Graphic Context schreiben, so dass diese in die Bitmap gewrappt wird.

    Um direkt in die Bitmap einen Pixel zu setzen, kannst du auch _GDIPlus_BitmapSetPixel() benutzen. Damit würdest du dir die Konvertierung zwischen GDI und GDI+ sparen.

    Gruß,
    UEZ

  • VBS-Skript nach AutoIT übersetzen

    • UEZ
    • 10. April 2014 um 14:09

    Schaue dir einfach mal diese UDF an: Active Directory Funktionen - Neue Version 1.4.1.0 freigegeben!

    Gruß,
    UEZ

  • Bild skalieren

    • UEZ
    • 3. April 2014 um 17:18

    Probiere es mal damit (nicht getestet):

    Spoiler anzeigen
    [autoit]


    _GDIPlus_Startup()
    ;Das ganze ist ein Geburtstagskalender, der mir an dem heutigen Tag die Info und ein Bild, von
    ;dem jenigen anzeigt, der Geburtstag hat. Über ein Datumsfeld kann man gezielt zu einem bestimmten
    ;Datum springen. Hier ein Teil des Codes...
    ;GUICtrlCreatePng springt in die Funktion GUICtrlCreatePng.. übergibt Filepath und "IniFileLine7", das ist ein Leeres Jpg
    ;um vorhergehende Bilder zu löschen .
    func start()

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

    While 1
    $msg = GUIGetMsg()
    Select
    case $msg = $cal
    ;~ Hier wird das Label zurückgesetzt
    GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,30,80,98)
    GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,320,80,98)
    GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,610,80,98)
    GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,30,200,98)
    GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,320,200,98)
    GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,610,200,98)
    GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,30,320,98)
    GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,320,320,98)
    GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,610,320,98)
    GUICtrlSetData ($Label, "")
    GUICtrlSetData ($Label1, "")
    GUICtrlSetData ($Label2, "")
    GUICtrlSetData ($Label3, "")
    GUICtrlSetData ($Label4, "")
    GUICtrlSetData ($Label5, "")
    GUICtrlSetData ($Label6, "")
    GUICtrlSetData ($Label7, "")
    GUICtrlSetData ($Label8, "")
    GUICtrlSetData ($Label9, "")
    connect()
    case $msg = $GUI_EVENT_CLOSE
    Exit
    case $msg = $beenden
    Exit
    ;~ Bilderpfad für vergrößerte Bilder
    case $msg = $Pict1
    $bigpic_var= $Picture1
    GUICtrlCreatePng1($Pict1,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
    case $msg = $Pict2
    $bigpic_var= $Picture2
    GUICtrlCreatePng1($Pict2,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
    case $msg = $Pict3
    $bigpic_var= $Picture3
    GUICtrlCreatePng1($Pict3,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
    case $msg = $Pict4
    $bigpic_var= $Picture4
    GUICtrlCreatePng1($Pict4,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
    case $msg = $Pict5
    $bigpic_var= $Picture5
    GUICtrlCreatePng1($Pict5,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
    case $msg = $Pict6
    $bigpic_var= $Picture6
    GUICtrlCreatePng1($Pict6,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
    case $msg = $Pict7
    $bigpic_var= $Picture7
    GUICtrlCreatePng1($Pict7,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
    case $msg = $Pict8
    $bigpic_var= $Picture8
    GUICtrlCreatePng1($Pict8,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
    case $msg = $Pict9
    $bigpic_var= $Picture9
    GUICtrlCreatePng1($Pict9,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
    case $msg = $help
    $x = $x + 1
    Help()
    case $msg = $dropdown_name
    NameSelect()
    case $msg = $mzi
    SplashTextOn ("Kontakt", "M" & @LF & "Beter"&@LF& "urg.cat"&@LF&@LF&"Dieses Fenster schließt sich automatisch!", 250,100, @DesktopWidth/2-125, @DesktopHeight/2-100,5, "calibri", 10)
    sleep(3000)
    SplashOff()
    EndSelect
    WEnd
    EndFunc

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

    ;~ Bilder (klein) erstellen
    Func GUICtrlCreatePng($iCtrl, $filepath_pic, $iPNG_Left = 0, $iPNG_Top = 0, $factor=0)

    Local $hImagePNG = _GDIPlus_ImageLoadFromFile($filepath_pic)
    Global $iPNG_Width = _GDIPlus_ImageGetWidth($hImagePNG)
    Global $iPNG_Height = _GDIPlus_ImageGetHeight($hImagePNG)
    Local $iPNG_faktor= $iPNG_Width/$factor
    Local $hBmp = _GDIPlus_ImageResize($hImagePNG, $iPNG_Width/$iPNG_faktor,$iPNG_Height/$iPNG_faktor) ;GDI+ Bitmap
    Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp) ;GDI Bitmap!
    If $iCtrl Then GUICtrlSendMsg($iCtrl, 0x0172, 0, $hHBitmap)

    _WinAPI_DeleteObject($hHBitmap)
    _GDIPlus_BitmapDispose($hBmp)
    _GDIPlus_ImageDispose($hImagePNG)

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

    EndFunc ;==>GUICtrlCreatePng

    [/autoit]

    Du kannst auch _GDIPlus_ImageScale() zum Skalieren benutzen, wenn du das Bild faktorisiert ändern möchtest.


    Gruß,
    UEZ

  • Schon wieder grafische Spielereien ;)

    • UEZ
    • 1. April 2014 um 23:33

    Echt coole Effekte :thumbup:

    Ich sehe, dass du jetzt die Strukt und somit Punkt Notation bevorzugst. Ist einfacher zu überblicken - sollte ich mir auch angewöhnen. 8o


    Gruß,
    UEZ

  • Bild skalieren

    • UEZ
    • 1. April 2014 um 15:53

    Brick,

    vielleicht solltest du den vollständigen Code posten, damit wir korrigieren können. Nur Fragmente bringen nicht viel!


    Gruß,
    UEZ

  • Bild skalieren

    • UEZ
    • 31. März 2014 um 21:07

    Probiere es mal damit:

    [autoit]


    Local $hBmp = _GDIPlus_ImageResize($hImagePNG, 300,500) ;GDI+ Bitmap
    Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp) ;GDI Bitmap!
    Local $iPNG_faktor= $iPNG_Width/300
    Local $iPNG_Height_res= $iPNG_Height/$iPNG_faktor
    Local $iPNG_Width_res = $iPNG_Width/$iPNG_faktor
    Local $cPNG_PIC = GUICtrlCreatePic("", $iPNG_Left, $iPNG_Top, $iPNG_Width_res, $iPNG_Height_res)
    GUICtrlSendMsg($cPNG_PIC, 0x0172, 0, $hHBitmap)
    _WinAPI_DeleteObject($hHBitmap)
    _GDIPlus_BitmapDispose($hBmp)
    _GDIPlus_ImageDispose($hImagePNG)

    [/autoit]

    Gruß,
    UEZ

  • Bild skalieren

    • UEZ
    • 31. März 2014 um 15:35

    Die Zeile

    [autoit]


    Local $hBmp = _GDIPlus_ImageResize(_GDIPlus_BitmapCreateHBITMAPFromBitmap($hImagePNG), 300,500)

    [/autoit]


    mach so keinen Sinn, denn du übergibst der Funktion GDIPlus_ImageResize() ein GDI Handle und kein GDI+ Handle!

    Also das Bild vorher skalieren, in ein GDI Bild umwandeln und zum Pic Control schicken.

    Gruß,
    UEZ

  • Desktop Lemmings

    • UEZ
    • 24. März 2014 um 20:39

    Einfach nur cooooooooooool :thumbup:

    Gruß,
    UEZ

  • Bilddaten als "Rohdaten" kopieren (ähnlich Öffnen->Strg+a->Strg+c)

    • UEZ
    • 11. März 2014 um 16:13

    Probiere es mal damit:

    [autoit]


    #include <Clipboard.au3>
    #include <Screencapture.au3>

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

    $hHBmp = _ScreenCapture_Capture("", 0, 0, 100, 100)
    $hClipboard_Bitmap = _WinAPI_CopyImage($hHBmp, 0, 0, 0, BitOR($LR_COPYDELETEORG, $LR_COPYRETURNORG))

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

    _ClipBoard_Open(0)
    _ClipBoard_Empty()
    _ClipBoard_SetDataEx($hClipboard_Bitmap, $CF_BITMAP)
    _ClipBoard_Close()
    _WinAPI_DeleteObject($hClipboard_Bitmap)
    _WinAPI_DeleteObject($hHBmp)

    [/autoit]

    Gruß,
    UEZ

  • Bilddaten als "Rohdaten" kopieren (ähnlich Öffnen->Strg+a->Strg+c)

    • UEZ
    • 11. März 2014 um 15:26

    Du musst das Bild, das du per Screenshot erstellt hast, in ein Clipboard Format umwandeln.

    Die Umwandlung mit einem GDI Bild, nicht GDI+, geht über die Funktion _WinAPI_CopyImage(), das du mit _ClipBoard_SetDataEx() in den Zwischenspeicher kopieren kannst.

    Gruß,
    UEZ

  • Happy Birthday GDI+ Meister

    • UEZ
    • 2. März 2014 um 19:22

    Eukalyptus,

    [Blockierte Grafik: http://i854.photobucket.com/albums/ab101/DirtyGirlMovies/mrbean.jpg]


    Bleib' uns noch lange erhalten und beglück uns mit deinen tollen (GDI+) Skripten!

    Gruß,
    UEZ

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

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