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

  • LED - Laufschrift

    • UEZ
    • 22. Februar 2010 um 14:37

    Sau geil!

    Gruß,
    UEZ

  • SciTe löscht ZeilenFormatierung

    • UEZ
    • 22. Februar 2010 um 12:55

    Versuche doch mal beide Dateien (SciTE.session und SciTEUser.properties in %USERPROFILE%) umzubennen! SciTE sollte nicht laufen!

    Es gibt auch eine SciTEGlobal.properties im SciTE Verzeichnis selbst, die vielleicht auch mal umbenennen, wenn der Versuch oben nicht funzt!

    Gruß,
    UEZ

  • Schlechte GDI+ Performance auf WinXP

    • UEZ
    • 22. Februar 2010 um 10:59

    Werde ich mal heute Abend auf meiner Kiste testen, wobei bei mir das allerdings schon einigermaßen sauber läuft (ab und zu flackert's mal kurz)! In der VM gab es so wie so keine Probleme!

    Gruß,
    UEZ

  • CSV-Editor V0.8 (Stand 23.04.2010)

    • UEZ
    • 21. Februar 2010 um 20:48

    Ein "Always on Top", Drag'n'Drop und farbige Zeilen wären außerdem noch nett!

    Ansonsten kann ich keine Fehler finden!

    Gruß,
    UEZ

  • 2 Variablen auslesen

    • UEZ
    • 21. Februar 2010 um 12:38

    Probiere es mal mit $Body = GUICtrlRead($Input1) & GUICtrlRead($Input2)

    Ansonsten hast du noch Fehler im Code!

    Gruß,
    UEZ

  • LED - Laufschrift

    • UEZ
    • 21. Februar 2010 um 12:23
    Zitat von AutoBert

    Hallo UEZ,

    in deiner neuen Version habe ich ein Flackern der Titelleiste, auch die Initialisierung am Anfang erscheint mir etwas zu lange,

    mfg (Auto)Bert

    Zitat von Jonathan


    Geht mir auch so, habe Win7 X86

    p.s. Ich muss natührlich meinen Senf dazugeben, das wenn man ein ¿ darstellt, das zuweit unten ist ^^

    Zitat von Jonathan


    Geht mir auch so, habe Win7 X86

    p.s. Ich muss natührlich meinen Senf dazugeben, das wenn man ein ¿ darstellt, das zuweit unten ist ^^


    Ich kann unter Vista x32 kein flackern erkennen, aber kommentiert doch mal die Zeilen WinSetTitle() (54 & 111) aus! Dadurch wird kein FPS mehr und beim Erstellen der LED Bitmap wird der Status nicht mehr angezeigt (sollte schneller sein)!

    Ihr könnt ja die Fenster- bzw. LED Größe manuell anpassen, so dass auch "komische" Zeichen besser dargestellt werden!

    Zitat von Raupi

    Sehr geil das ganze. Danke Eukalyptus und UEZ :thumbup:

    Der Danke sollte an Eukalyptus gehen! Mein Beitrag dazu ist eher nebensächlich und eher von kosmetischer Natur :!: :rolleyes:

    Gruß,
    UEZ

  • Autoit und Konvertieren

    • UEZ
    • 21. Februar 2010 um 00:29

    Avi ist ein Video Container! Du musst den Audiostream demuxen und dann evt. umwandeln. Vielleicht kannst du mit AutoIt die Tools steuern, aber mit AutoIt den Audio Stream demuxen ist noch nicht implementiert!

    Gruß,
    UEZ

  • LED - Laufschrift

    • UEZ
    • 20. Februar 2010 um 23:10

    Ich habe mal eine andere Backbuffer Technik benutzt, um GDI+ zu beschleunigen und die korrigierten GDI+ Funktion von progandy noch hinzugefügt!

    Guckst du Post#14 :D

    Gruß,
    UEZ

  • CSV-Editor V0.8 (Stand 23.04.2010)

    • UEZ
    • 19. Februar 2010 um 23:34
    Zitat von PrideRage

    Sieht schön aus, jedoch weiss ich nicht ganz, was CSV is ^^
    Aber ich entnehme aus dem Post von UEZ das es sich um Excel dateien handelt.
    Finds also dementsprechend recht gut gelungen, jedoch nicht wirklich
    geeignet für normale text dateien.
    MfG. PrideRage

    CSV = Comma-separated values

    Gruß,
    UEZ

  • CSV-Editor V0.8 (Stand 23.04.2010)

    • UEZ
    • 19. Februar 2010 um 23:10

    Nette Idee, um mal schnell CSV Dateien angezeigt zu bekommen, ohne gleich mit der Excel Keule zuzuschlagen!


    Ideen:

    • ich habe CSVs mit Header, d.h. wäre schön, wenn diese Header auch angezeigt werden könnten, anstelle von Col1, Col2, usw.
    • Fenstergröße sollte änderbar sein
    • Sortierfunktion auf die einzelnen Spalten, z.B. wenn ich nach Spalte x sortieren will + Speicherfunktion der veränderten Tabelle
    • vielleicht Editierfunktionen für Zellen (hast ja CSV Editior benannt ;))


    Gruß,
    UEZ

  • AutoItObject - OOP für AutoIt

    • UEZ
    • 19. Februar 2010 um 22:19

    Coole Sache OOP mit AutoIt! Jetzt muss ich mir nur noch OOP reinziehen und verstehen!

    Mal sehen, ob man damit auch GDI+ mit Klassen verwenden kann! Aber bis dahin ist noch ein langer weg für mich...

    Danke für die OOP Implementierung :thumbup: :!:

    Warum wurde eine DLL hinzugefügt? Ursprünglich war dich keine dabei oder?


    Gruß,
    UEZ

  • GDI+ Image Rotator and Saver

    • UEZ
    • 19. Februar 2010 um 21:51
    Zitat von Greek

    Jetzt wo du es sagt, es sind genau die selben Bilder bei deinen sowohl meins als auch deins nicht geht, bzw. Fehler enthalten, sehr komisch.

    Der Work-Around ist _GDIPlus_GraphicsDrawImageRect() anstelle von _GDIPlus_GraphicsDrawImage() zu benutzen! Ich weiß nicht, warum einige Bilder mit _GDIPlus_GraphicsDrawImage() gestreckt angezeigt werden! ?(

    Gruß,
    UEZ

  • LED - Laufschrift

    • UEZ
    • 19. Februar 2010 um 19:59
    Zitat von progandy


    Versuch es mal ohne, aber dafür mit den korrekten DllCall-Typen:

    Danke progandy! Hatte die Funktionen nicht auf korrekte DLLCalls geprüft :whistling:

    Läuft jetzt auch unter Win7 x64 "sauber"!

    Gruß,
    UEZ

  • LED - Laufschrift

    • UEZ
    • 19. Februar 2010 um 15:39
    Zitat von chip

    Hat schon was lustiges inzwischen. Wieder eine modifizierte Sache von dir, die bei mir unter Win 7 nicht geht XD.

    Wenn du Win7 x64 benutzt, dann vorher mit der Option #AutoIt3Wrapper_UseX64=n kompilieren und die Exe starten. Jetzt sollte es funzen, oder?

    Gruß,
    UEZ

  • Zeigeruhr

    • UEZ
    • 19. Februar 2010 um 15:36
    Zitat von TheShadowAE

    Doch durch die Modifikationen geht es, aber das verschieben und der Rand (gibt Spuren) ist immernoch da :D
    Trotzdem Danke.

    Was meinst du mit "das verschieben und der Rand (gibt Spuren) ist immernoch da"? An den Window Moves habe ich nichts geändert, sondern nur ein wenig an der GUI...

    UEZ

  • Zeigeruhr

    • UEZ
    • 19. Februar 2010 um 09:40

    Ist gut geworden!

    Hier ein paar kleine Modifikationen:

    Spoiler anzeigen
    [autoit]


    #notrayicon
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <GDIPlus.au3>
    #include <Date.au3>
    #include <Misc.au3>

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

    global $fx=@DesktopWidth-225 ;-100
    global $fy=@DesktopHeight-160 ;-35
    $tmp=iniread("Uhr.ini","coords","x","x")
    if $tmp<>"x" Then $fx=int($tmp)
    $tmp=iniread("Uhr.ini","coords","y","y")
    if $tmp<>"y" Then $fy=int($tmp)
    global $title="Uhr"
    _GDIPlus_Startup()
    global $uhr=_GDIPlus_BitmapCreateFromFile(@ScriptDir&"\Uhr.png")
    global $iX = _GDIPlus_ImageGetWidth($uhr)
    global $iY = _GDIPlus_ImageGetHeight($uhr)
    global $iX_2 = $iX / 2
    Global $iY_2 = $iY / 2
    global $zeiger_l1 = 62
    global $zeiger_l2 = 52
    global $zeiger_l3 = 32
    #Region ### START Koda GUI section ### Form=d:\progen\autoit\meine\forms\analog.kxf
    $Form1 = GUICreate($title, $iX, $iY, $fx, $fy, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW,$WS_EX_LAYERED))
    $Label1 = GUICtrlCreateLabel("",0,0)
    _WinAPI_SetLayeredWindowAttributes($Form1, 0xE0DFE3)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    winsetontop($title,"",1)

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

    global $pen=_GDIPlus_PenCreate(0xFFFF0000,2)
    global $pen2=_GDIPlus_PenCreate(0xFF0000FF,2)
    global $pen3=_GDIPlus_PenCreate(0xFF0000BB,2)
    global $gra=_GDIPlus_GraphicsCreateFromHWND($Form1)
    global $buffer=_GDIPlus_BitmapCreateFromGraphics($iX,$iY,$gra)
    global $backgra=_GDIPlus_ImageGetGraphicsContext($buffer)
    _GDIPlus_GraphicsSetSmoothingMode($backgra, 2)
    global const $pi_div_180 = 4 * ATan(1) / 180
    Opt("GUIOnEventMode", 1)
    GUIRegisterMsg(0x000F, "Redraw_GUI")
    GUISetOnEvent($GUI_EVENT_CLOSE,"ende")
    adlibregister("x",100)

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

    While not _IsPressed("1B")
    if _IsPressed("1") Then
    $pos=mousegetpos()
    $winpos=WinGetPos($title)
    if $winpos[0]+100<=$pos[0] and $winpos[0]+225>=$pos[0] and $winpos[1]+35<=$pos[1] and $winpos[1]+160>=$pos[1] Then
    $xplus=$pos[0]-$winpos[0]-100
    $yplus=$pos[1]-$winpos[1]-35
    while _IsPressed("1")
    $pos=MouseGetPos()
    winmove($title,"",$pos[0]-100-$xplus,$pos[1]-35-$yplus)
    $fx=$pos[0]-100-$xplus
    $fy=$pos[1]-35-$yplus
    if $fx<-100 then
    winmove($title,"",-100,$fy)
    $fx=-100
    endif
    if $fy<-35 then
    winmove($title,"",$fx,-35)
    $fy=-35
    endif
    if $fx>@DesktopWidth-225 then
    winmove($title,"",@DesktopWidth-225,$fy)
    $fx=@DesktopWidth-225
    endif
    if $fy>@DesktopHeight-160 then
    winmove($title,"",$fx,@DesktopHeight-160)
    $fy=@DesktopHeight-160
    endif
    sleep(50)
    WEnd
    EndIf
    EndIf
    sleep(50)
    WEnd
    ende()

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

    Func ende()
    iniwrite("Uhr.ini","coords","x",$fx)
    iniwrite("Uhr.ini","coords","y",$fy)
    winsetontop($title,"",0)
    adlibunregister("x")
    _GDIPlus_PenDispose($pen)
    _GDIPlus_PenDispose($pen2)
    _GDIPlus_PenDispose($pen3)
    _GDIPlus_GraphicsDispose($gra)
    _GDIPlus_BitmapDispose($uhr)
    _GDIPlus_BitmapDispose($buffer)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

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

    func Redraw_GUI($hWnd, $msg, $wParam, $lParam)
    _WinAPI_RedrawWindow($hWnd, "", "", $RDW_UPDATENOW + $RDW_FRAME)
    ;~ _GDIPlus_GraphicsClear($backgra,0x00000000)
    _GDIPlus_GraphicsDrawImage($backgra,$uhr,0,0)
    $winkel=int(stringmid(_NowTime(),7,2))+30
    _GDIPlus_GraphicsDrawLine($backgra,$iX_2,$iY_2,$iX_2 + $zeiger_l1 * Sin($winkel * -6 * $Pi_Div_180),$iY_2 + $zeiger_l1 * Cos($winkel * -6 * $Pi_Div_180), $pen)
    $winkel=int(stringmid(_NowTime(),4,2))+30
    _GDIPlus_GraphicsDrawLine($backgra,$iX_2,$iY_2,$iX_2 + $zeiger_l2 * Sin($winkel * -6 * $Pi_Div_180),$iY_2 + $zeiger_l2 * Cos($winkel * -6 * $Pi_Div_180), $pen2)
    $winkel=(int(stringmid(_NowTime(),1,2))+6)*5
    _GDIPlus_GraphicsDrawLine($backgra,$iX_2,$iY_2,$iX_2 + $zeiger_l3 * Sin($winkel * -6 * $Pi_Div_180),$iY_2 + $zeiger_l3 * Cos($winkel * -6 * $Pi_Div_180), $pen3)
    _GDIPlus_GraphicsDrawImageRect($gra,$buffer,0,0,$iX,$iY)
    EndFunc

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

    func x()
    GUICtrlSetData($Label1,"")
    endfunc

    [/autoit]

    Gruß,
    UEZ

  • LED - Laufschrift

    • UEZ
    • 18. Februar 2010 um 00:20

    Ich habe mal versucht den LEDs mehr Volumen zu geben!

    Hier das Resultat:

    Neue Backbuffer Technik:

    Spoiler anzeigen
    [autoit]


    ;http://www.autoit.de/index.php?page=Thread&threadID=17855
    #include <GDIPlus.au3>
    #include <WinAPI.au3>
    #include <WindowsConstants.au3>
    #include <GDIPlusConstants.au3>
    #include <GUIConstantsEx.au3>
    Opt("GUIOnEventMode", 1)

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

    Local $fps = 0, $fps_diff, $fps_maintimer, $fps_timer, $display_FPS = -1, $average_FPS, $i = 1
    Local $w = 1024
    Local $h = 384
    Local $iX = 0, $iW, $iStep = 24
    _GDIPlus_Startup()
    Local $hGui = GUICreate("LED Laufschrift", $w, $h)
    GUISetBkColor(0x000000)
    GUISetOnEvent(-3, "_Exit")
    GUISetState()

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

    ;~ Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
    ;~ Local $hBitmapBuffer = _GDIPlus_BitmapCreateFromGraphics($w, $h, $hGraphics)
    ;~ Local $hGraphicsBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmapBuffer)

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

    Local $hDC = _WinAPI_GetWindowDC($hGUI)
    Local $hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC)

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

    Local $hBMP = _WinAPI_CreateBitmap($w, $h) ;create a dummy bitmap
    Local $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBMP)
    Local $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)

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

    Local $hScrDC = _WinAPI_GetDC(0)
    Local $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hScrDC)
    Local $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hBitmap)
    Local $hGraphicsBuffer = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer)

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

    _GDIPlus_GraphicsClear($hGraphics, 0xFF000000)
    Local $hBitmapLed = _CreateLedBitmap($hGraphics, "LED Laufschrift mit GDI+ erstellt von Eukalyptus ;) ", $w, $h, $iStep, $iStep, 0xFFFFF030, 0x90101000)
    ;Local $hBitmapLed = _CreateLedBitmap($hGraphics, "Dies ist eine Laufschrift!", 800, 200, $iStep, $iStep, 0xFF00FF00, 0x66000000)
    $iW = @extended

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

    ;~ GUIRegisterMsg($WM_PAINT, "_WM_PAINT")
    $fps_maintimer = TimerInit()
    While 1
    $fps_timer = TimerInit()
    $iX -= $iStep
    If $iX + $iW < 0 Then $iX += $iW
    _GDIPlus_GraphicsDrawImage($hGraphicsBuffer, $hBitmapLed, $iX, 0)
    ;~ _GDIPlus_GraphicsDrawImage($hGraphicsBuffer, $hBitmapLed, $iX + $iW, 0)
    ;~ _WinAPI_RedrawWindow($hGui, 0, 0, $RDW_INTERNALPAINT)
    ;~ _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmapBuffer, 0, 0, $w, $h)
    _WinAPI_BitBlt($hDC, 3, 23, $w, $h, $hDC_backbuffer, 0, 0, 0x00CC0020)
    $fps_diff = TimerDiff($fps_timer)
    If TimerDiff($fps_maintimer) >= 1000 Then ;calculate FPS
    $fps = Round(1000 / $fps_diff, 2)
    WinSetTitle($hGui, "", "LED Laufschrift: " & $fps & " FPS (ø " & Round($average_FPS / $i, 2) & " FPS)")
    $fps_maintimer = TimerInit()
    EndIf
    $average_FPS += $fps
    $i += 1
    Sleep(50)
    WEnd

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

    ;~ Func _WM_PAINT($hWnd, $Msg, $wParam, $lParam)
    ;~ _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmapBuffer, 0, 0, $w, $h)
    ;~ Return $GUI_RUNDEFMSG
    ;~ EndFunc ;==>_WM_PAINT

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

    Func _CreateLedBitmap($hGraphics, $sText, $iW, $iH, $iLedOffSet, $iLedSize, $iOnColor = 0xF0FFFF00, $iOffColor = 0x88111122, $sFont = "Arial")
    $sText = StringUpper(StringReplace($sText,@LF,""))
    Local $hBrushOff = _GDIPlus_BrushCreateSolid($iOffColor)
    Local $hFormat = _GDIPlus_StringFormatCreate()
    Local $hFamily = _GDIPlus_FontFamilyCreate($sFont)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $iH, 1, 2)
    Local $tLayout = _GDIPlus_RectFCreate($iW, 0, 0, 0)
    Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $sText, $hFont, $tLayout, $hFormat)
    Local $iWidth = Ceiling(DllStructGetData($aInfo[0], "Width")) + $iW
    $iWidth -= Mod($iWidth, $iLedOffSet)
    Local $iHeight = Ceiling(DllStructGetData($aInfo[0], "Height"))
    DllStructSetData($aInfo[0], "Y", -Round(($iHeight - $iH) / 3))
    Local $hBitmapTxt = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics)
    Local $hBitmapLed = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics)
    Local $hGraphicsTxt = _GDIPlus_ImageGetGraphicsContext($hBitmapTxt)
    Local $hGraphicsLed = _GDIPlus_ImageGetGraphicsContext($hBitmapLed)
    Local $hBrush = _GDIPlus_BrushCreateSolid($iOnColor)
    Local $hPen = _GDIPlus_PenCreate()
    _GDIPlus_GraphicsClear($hGraphicsTxt, $iOffColor)
    _GDIPlus_GraphicsDrawStringEx($hGraphicsTxt, $sText, $hFont, $aInfo[0], $hFormat, $hBrush)
    Local $BitmapData = _GDIPlus_BitmapLockBits($hBitmapTxt, 0, 0, $iWidth, $iHeight, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
    Local $Stride = DllStructGetData($BitmapData, "Stride")
    Local $Width = DllStructGetData($BitmapData, "Width")
    Local $Height = DllStructGetData($BitmapData, "Height")
    Local $Scan0 = DllStructGetData($BitmapData, "Scan0")
    Local $PixelData, $Color = Hex($iOnColor)
    Local $hBrushGrad, $hPath
    Local $progress = ($Height * $Width - 2) / ($iLedOffSet ^ 2), $c = 1
    For $row = 0 To $Height - 1 Step $iLedOffSet
    For $col = 0 To $Width - 1 Step $iLedOffSet
    $PixelData = DllStructCreate("dword", $Scan0 + ($row * $Stride) + ($col * 4))
    If Hex(DllStructGetData($PixelData, 1)) = $Color Then
    $hPath = _GDIPlus_CreatePath()
    _GDIPlus_AddPathEllipse($hPath, $col, $row, $iLedSize, $iLedSize)
    $hBrushGrad = _GDIPlus_CreatePathGradientFromPath($hPath)
    _GDIPlus_SetLineGammaCorrection($hBrushGrad, True)
    _GDIPlus_SetPathGradientSurroundColorsWithCount($hBrushGrad, $iOffColor)
    _GDIPlus_SetPathGradientCenterColor($hBrushGrad, $iOnColor)
    _GDIPlus_FillPath($hGraphicsLed, $hBrushGrad, $hPath)
    _GDIPlus_ClosePathFigure($hPath)
    _GDIPlus_GraphicsDrawEllipse($hGraphicsLed, $col, $row, $iLedSize, $iLedSize, $hPen)
    Else
    _GDIPlus_GraphicsFillEllipse($hGraphicsLed, $col, $row, $iLedSize, $iLedSize, $hBrushOff)
    EndIf
    WinSetTitle($hGui, "", "LED Laufschrift: " & Int($c / $progress * 100) & " %")
    $c += 1
    Next
    Next
    _GDIPlus_BitmapUnlockBits($hBitmapTxt, $BitmapData)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_BrushDispose($hBrushGrad)
    _GDIPlus_PathDispose($hPath)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_BrushDispose($hBrushOff)
    _GDIPlus_BitmapDispose($hBitmapTxt)
    _GDIPlus_GraphicsDispose($hGraphicsTxt)
    _GDIPlus_GraphicsDispose($hGraphicsLed)
    Return SetExtended($iWidth, $hBitmapLed)
    EndFunc ;==>_CreateLedBitmap

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

    Func _Exit()
    _WinAPI_ReleaseDC($hGUI, $hDC)
    _WinAPI_DeleteObject($hBMP)
    _GDIPlus_BitmapDispose($hImage)
    _WinAPI_DeleteObject($hBitmap)
    _WinAPI_ReleaseDC(0, $hScrDC)
    _WinAPI_DeleteDC($hDC_backbuffer)
    _GDIPlus_GraphicsDispose($hGraphicsBuffer)

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

    _GDIPlus_BitmapDispose($hBitmapLed)
    ;~ _GDIPlus_GraphicsDispose($hGraphicsBuffer)
    ;~ _GDIPlus_BitmapDispose($hBitmapBuffer)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>_Exit

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

    Func _GDIPlus_CreatePath($brushMode=0)
    Local $hPath
    $hPath = DllCall($ghGDIPDll, "int", "GdipCreatePath", "int", $brushMode, "handle*", 0)
    If @error Then Return SetError(1,@error,0)
    Return SetError($hPath[0], 0, $hPath[2])
    EndFunc

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

    Func _GDIPlus_AddPathEllipse($hPath, $iX, $iY, $iWidth, $iHeight)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipAddPathEllipse", "handle", $hPath, "float", $iX, "float", $iY, "float", $iWidth, "float", $iHeight)
    If @error Then Return SetError(1,@error,0)
    Return SetError($aResult[0], 0, $aResult[0]=0)
    EndFunc

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

    Func _GDIPlus_CreatePathGradientFromPath($hPath)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreatePathGradientFromPath", "handle", $hPath, "int*", 0)
    If @error Then Return SetError(1,@error,0)
    Return SetError($aResult[0], 0, $aResult[2])
    EndFunc

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

    Func _GDIPlus_SetLineGammaCorrection($hBrush, $useGammaCorrection = True)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetLineGammaCorrection", "handle", $hBrush, "int", $useGammaCorrection)
    If @error Then Return SetError(1,@error,0)
    Return SetError($aResult[0], 0, $aResult[0]=0)
    EndFunc

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

    Func _GDIPlus_SetPathGradientCenterColor($hBrush, $iARGB)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPathGradientCenterColor", "handle", $hBrush, "int", $iARGB)
    If @error Then Return SetError(1,@error,0)
    Return SetError($aResult[0], 0, $aResult[0]=0)
    EndFunc

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

    Func _GDIPlus_FillPath($hGraphic, $hBrushGrad, $hPath)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipFillPath", "handle", $hGraphic, "handle", $hBrushGrad, "handle", $hPath)
    If @error Then Return SetError(1,@error,0)
    Return SetError($aResult[0], 0, $aResult[0]=0)
    EndFunc

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

    Func _GDIPlus_SetPathGradientSurroundColorsWithCount($hBrush, $aArgb)
    Local $iI, $iCount, $aResult, $res, $x, $pArgb
    If IsArray($aArgb) Then
    $iCount = UBound($aArgb)
    $tArgb = DllStructCreate("int[" & $iCount & "]")
    $pArgb = DllStructGetPtr($tArgb)
    For $iI = 0 To $iCount - 1
    DllStructSetData($tArgb, 1, $aArgb[$iI], $iI + 1)
    Next
    Else
    $iCount = 1
    $tArgb = DllStructCreate("int")
    $pArgb = DllStructGetPtr($tArgb)
    DllStructSetData($tArgb, 1, $aArgb, 1)
    EndIf
    $aResult = DllCall($ghGDIPDll, "int", "GdipSetPathGradientSurroundColorsWithCount", "handle", $hBrush, "int", $pArgb, "int*", $iCount)
    If @error Then Return SetError(1,@error,0)
    Return SetError($aResult[0], $aResult[3], $aResult[0]=0)
    EndFunc

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

    Func _GDIPlus_ClosePathFigure($hPath)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipClosePathFigure", "handle", $hPath)
    If @error Then Return SetError(1,@error,0)
    Return SetError($aResult[0], 0, $aResult[0]=0)
    EndFunc

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

    Func _GDIPlus_PathDispose($hPath)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipDeletePath", "handle", $hPath)
    If @error Then Return SetError(1,@error,0)
    Return SetError($aResult[0], 0, $aResult[0]=0)
    EndFunc

    [/autoit]

    Alte:

    Spoiler anzeigen
    [autoit]


    ;http://www.autoit.de/index.php?page=Thread&threadID=17855
    #include <GDIPlus.au3>
    #include <WinAPI.au3>
    #include <WindowsConstants.au3>
    #include <GDIPlusConstants.au3>
    #include <GUIConstantsEx.au3>
    Opt("GUIOnEventMode", 1)

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

    Local $fps = 0, $fps_diff, $fps_maintimer, $fps_timer, $display_FPS = -1, $average_FPS, $i = 1
    Local $w = 1024
    Local $h = 384
    Local $iX = 0, $iW, $iStep = 24
    _GDIPlus_Startup()
    Local $hGui = GUICreate("LED Laufschrift", $w, $h)
    GUISetBkColor(0x000000)
    GUISetOnEvent(-3, "_Exit")
    GUISetState()

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

    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
    Local $hBitmapBuffer = _GDIPlus_BitmapCreateFromGraphics($w, $h, $hGraphics)
    Local $hGraphicsBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmapBuffer)

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

    _GDIPlus_GraphicsClear($hGraphics, 0xFF000000)
    Local $hBitmapLed = _CreateLedBitmap($hGraphics, "LED Laufschrift mit GDI+ erstellt von Eukalyptus ;) ", $w, $h, $iStep, $iStep, 0xFFFFF030, 0x88101000)
    ;Local $hBitmapLed = _CreateLedBitmap($hGraphics, "Dies ist eine Laufschrift!", 800, 200, $iStep, $iStep, 0xFF00FF00, 0x66000000)
    $iW = @extended

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

    ;~ GUIRegisterMsg($WM_PAINT, "_WM_PAINT")
    $fps_maintimer = TimerInit()
    While 1
    $fps_timer = TimerInit()
    $iX -= $iStep
    If $iX + $iW < 0 Then $iX += $iW
    _GDIPlus_GraphicsDrawImage($hGraphicsBuffer, $hBitmapLed, $iX, 0)
    _GDIPlus_GraphicsDrawImage($hGraphicsBuffer, $hBitmapLed, $iX + $iW, 0)
    _WinAPI_RedrawWindow($hGui, 0, 0, $RDW_INTERNALPAINT)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmapBuffer, 0, 0, $w, $h)
    $fps_diff = TimerDiff($fps_timer)
    If TimerDiff($fps_maintimer) >= 1000 Then ;calculate FPS
    $fps = Round(1000 / $fps_diff, 2)
    WinSetTitle($hGui, "", "LED Laufschrift: " & $fps & " FPS (ø " & Round($average_FPS / $i, 2) & " FPS)")
    $fps_maintimer = TimerInit()
    EndIf
    $average_FPS += $fps
    $i += 1
    Sleep(50)
    WEnd

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

    ;~ Func _WM_PAINT($hWnd, $Msg, $wParam, $lParam)
    ;~ _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmapBuffer, 0, 0, $w, $h)
    ;~ Return $GUI_RUNDEFMSG
    ;~ EndFunc ;==>_WM_PAINT

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

    Func _CreateLedBitmap($hGraphics, $sText, $iW, $iH, $iLedOffSet, $iLedSize, $iOnColor = 0xF0FFFF00, $iOffColor = 0x88111122, $sFont = "Arial")
    $sText = StringUpper(StringReplace($sText, @LF, ""))
    Local $hBrushOff = _GDIPlus_BrushCreateSolid($iOffColor)
    Local $hFormat = _GDIPlus_StringFormatCreate()
    Local $hFamily = _GDIPlus_FontFamilyCreate($sFont)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $iH, 1, 2)
    Local $tLayout = _GDIPlus_RectFCreate($iW, 0, 0, 0)
    Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $sText, $hFont, $tLayout, $hFormat)
    Local $iWidth = Ceiling(DllStructGetData($aInfo[0], "Width")) + $iW
    $iWidth -= Mod($iWidth, $iLedOffSet)
    Local $iHeight = Ceiling(DllStructGetData($aInfo[0], "Height"))
    DllStructSetData($aInfo[0], "Y", -Round(($iHeight - $iH) / 3))
    Local $hBitmapTxt = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics)
    Local $hBitmapLed = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics)
    Local $hGraphicsTxt = _GDIPlus_ImageGetGraphicsContext($hBitmapTxt)
    Local $hGraphicsLed = _GDIPlus_ImageGetGraphicsContext($hBitmapLed)
    Local $hBrush = _GDIPlus_BrushCreateSolid($iOnColor)
    Local $hPen = _GDIPlus_PenCreate()
    _GDIPlus_GraphicsClear($hGraphicsTxt, $iOffColor)
    _GDIPlus_GraphicsDrawStringEx($hGraphicsTxt, $sText, $hFont, $aInfo[0], $hFormat, $hBrush)
    Local $BitmapData = _GDIPlus_BitmapLockBits($hBitmapTxt, 0, 0, $iWidth, $iHeight, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
    Local $Stride = DllStructGetData($BitmapData, "Stride")
    Local $Width = DllStructGetData($BitmapData, "Width")
    Local $Height = DllStructGetData($BitmapData, "Height")
    Local $Scan0 = DllStructGetData($BitmapData, "Scan0")
    Local $PixelData, $Color = Hex($iOnColor)
    Local $hBrushGrad, $hPath
    Local $progress = ($Height * $Width - 2) / ($iLedOffSet ^ 2), $c = 1
    For $row = 0 To $Height - 1 Step $iLedOffSet
    For $col = 0 To $Width - 1 Step $iLedOffSet
    $PixelData = DllStructCreate("dword", $Scan0 + ($row * $Stride) + ($col * 4))
    If Hex(DllStructGetData($PixelData, 1)) = $Color Then
    $hPath = _GDIPlus_CreatePath()
    _GDIPlus_AddPathEllipse($hPath, $col, $row, $iLedSize, $iLedSize)
    $hBrushGrad = _GDIPlus_CreatePathGradientFromPath($hPath)
    _GDIPlus_SetLineGammaCorrection($hBrushGrad, True)
    _GDIPlus_SetPathGradientSurroundColorsWithCount($hBrushGrad, $iOffColor)
    _GDIPlus_SetPathGradientCenterColor($hBrushGrad, $iOnColor)
    _GDIPlus_FillPath($hGraphicsLed, $hBrushGrad, $hPath)
    _GDIPlus_ClosePathFigure($hPath)
    _GDIPlus_GraphicsDrawEllipse($hGraphicsLed, $col, $row, $iLedSize, $iLedSize, $hPen)
    Else
    _GDIPlus_GraphicsFillEllipse($hGraphicsLed, $col, $row, $iLedSize, $iLedSize, $hBrushOff)
    EndIf
    WinSetTitle($hGui, "", "LED Laufschrift: " & Int($c / $progress * 100) & " %")
    $c += 1
    Next
    Next
    _GDIPlus_BitmapUnlockBits($hBitmapTxt, $BitmapData)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_BrushDispose($hBrushGrad)
    _GDIPlus_PathDispose($hPath)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_BrushDispose($hBrushOff)
    _GDIPlus_BitmapDispose($hBitmapTxt)
    _GDIPlus_GraphicsDispose($hGraphicsTxt)
    _GDIPlus_GraphicsDispose($hGraphicsLed)
    Return SetExtended($iWidth, $hBitmapLed)
    EndFunc ;==>_CreateLedBitmap

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

    Func _Exit()
    _GDIPlus_BitmapDispose($hBitmapLed)
    _GDIPlus_GraphicsDispose($hGraphicsBuffer)
    _GDIPlus_BitmapDispose($hBitmapBuffer)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>_Exit

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

    Func _GDIPlus_CreatePath($brushMode = 0)
    Local $hPath
    $hPath = DllCall($ghGDIPDll, "int", "GdipCreatePath", "int", $brushMode, "handle*", 0)
    If @error Then Return SetError(1, @error, 0)
    Return SetError($hPath[0], 0, $hPath[2])
    EndFunc ;==>_GDIPlus_CreatePath

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

    Func _GDIPlus_AddPathEllipse($hPath, $iX, $iY, $iWidth, $iHeight)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipAddPathEllipse", "handle", $hPath, "float", $iX, "float", $iY, "float", $iWidth, "float", $iHeight)
    If @error Then Return SetError(1, @error, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
    EndFunc ;==>_GDIPlus_AddPathEllipse

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

    Func _GDIPlus_CreatePathGradientFromPath($hPath)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreatePathGradientFromPath", "handle", $hPath, "int*", 0)
    If @error Then Return SetError(1, @error, 0)
    Return SetError($aResult[0], 0, $aResult[2])
    EndFunc ;==>_GDIPlus_CreatePathGradientFromPath

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

    Func _GDIPlus_SetLineGammaCorrection($hBrush, $useGammaCorrection = True)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetLineGammaCorrection", "handle", $hBrush, "int", $useGammaCorrection)
    If @error Then Return SetError(1, @error, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
    EndFunc ;==>_GDIPlus_SetLineGammaCorrection

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

    Func _GDIPlus_SetPathGradientCenterColor($hBrush, $iARGB)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPathGradientCenterColor", "handle", $hBrush, "int", $iARGB)
    If @error Then Return SetError(1, @error, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
    EndFunc ;==>_GDIPlus_SetPathGradientCenterColor

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

    Func _GDIPlus_FillPath($hGraphic, $hBrushGrad, $hPath)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipFillPath", "handle", $hGraphic, "handle", $hBrushGrad, "handle", $hPath)
    If @error Then Return SetError(1, @error, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
    EndFunc ;==>_GDIPlus_FillPath

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

    Func _GDIPlus_SetPathGradientSurroundColorsWithCount($hBrush, $aArgb)
    Local $iI, $iCount, $aResult, $res, $x, $pArgb
    If IsArray($aArgb) Then
    $iCount = UBound($aArgb)
    $tArgb = DllStructCreate("int[" & $iCount & "]")
    $pArgb = DllStructGetPtr($tArgb)
    For $iI = 0 To $iCount - 1
    DllStructSetData($tArgb, 1, $aArgb[$iI], $iI + 1)
    Next
    Else
    $iCount = 1
    $tArgb = DllStructCreate("int")
    $pArgb = DllStructGetPtr($tArgb)
    DllStructSetData($tArgb, 1, $aArgb, 1)
    EndIf
    $aResult = DllCall($ghGDIPDll, "int", "GdipSetPathGradientSurroundColorsWithCount", "handle", $hBrush, "int", $pArgb, "int*", $iCount)
    If @error Then Return SetError(1, @error, 0)
    Return SetError($aResult[0], $aResult[3], $aResult[0] = 0)
    EndFunc ;==>_GDIPlus_SetPathGradientSurroundColorsWithCount

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

    Func _GDIPlus_ClosePathFigure($hPath)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipClosePathFigure", "handle", $hPath)
    If @error Then Return SetError(1, @error, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
    EndFunc ;==>_GDIPlus_ClosePathFigure

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

    Func _GDIPlus_PathDispose($hPath)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipDeletePath", "handle", $hPath)
    If @error Then Return SetError(1, @error, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
    EndFunc ;==>_GDIPlus_PathDispose

    [/autoit]

    Gruß,
    UEZ

    Dateien

    LED Laufschrift New.au3 9,97 kB – 680 Downloads
  • HAPPY BIRTHDAY @ UEZ

    • UEZ
    • 17. Februar 2010 um 17:41

    So, nun bin ich von der PowerShell Schulung zurück!

    Ich möchte mich bei allen Gratulanten bedanken und auch den jenigen gratulieren, die außer mir auch noch heute Geburtstag haben!

    Uns allen zusammen wünsche ich Gesundheit und eine schöne Zeit mit AutoIt!

    @tince: wie hast du mein Bild gefunden? Google hat ja einige Daten von mir, aber ein Bild? :rofl:


    VIELEN DANK!

    Gruß,
    UEZ

    PS: midlife crisis rückt näher...

  • GDI+ PunkteDieVonWändenAbprallenScript

    • UEZ
    • 17. Februar 2010 um 17:26

    Sieht gut aus! Weiter so!

    Jeder darf meine Codes benutzen, wie er/sie will :!:

    Gruß,
    UEZ

  • LED - Laufschrift

    • UEZ
    • 17. Februar 2010 um 14:27

    Sehr schönes Skript! :thumbup:


    Zum Löschen des Startbildschirms: _GDIPlus_GraphicsClear($hGraphics, 0xFF000000) in Zeile 19 ersetzen!


    Ich habe mich auch _GDIPlus_BitmapLockBits() und _GDIPlus_BitmapUnlockBits() beschäfftigt, bin aber momentan noch nicht ganz dahinter gestiegen, wozu man die Funktion benutzen kann...


    Gruß,

    UEZ


    PS: Eukalyptus ist ein GDI+ Meister! ;)

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™