Mal wieder hat mich Youtube aufgeregt, weil irdendwo wieder irgendwelche dubiosen Gebühren an zwielichtige Personen nicht gezahlt wurden.
Da GDI+ in Echtzeit leider keine Verpixelung zulässt und ich nicht auf Pointer/ASM oder sonstiges zurückgreifen wollte (pures GDI+) muss das Bild leider gepuffert werden.
Das sollte im Allgemeinen aber nur ein paar Sekunden in Anspruch nehmen.
Einstellungen wie immer in den ersten paar Zeilen.
"GDI+ Skript"
#include <GDIPlus.au3>
Opt('GUIOnEventMode', 1)
[/autoit] [autoit][/autoit] [autoit]Global Const $sTitle = 'Test', _
$iW = 640, _
$iFrames = 5, _
$iStep = 2, _
$sText = 'Leider ist dieses Video, das Musik von XYZ' & @CRLF & 'beinhaltet, in Deutschland nicht verfügbar, da' & @CRLF & 'die GEMA euch eures Spaßes berauben will.' & @CRLF & 'Geld regiert die Welt.', _
$iH = $iW/@DesktopWidth*@DesktopHeight, _
$iLines = ArrGetIndex(StringSplit($sText, @CR),0)
Global $hGUI, $hGFX, $hBMP, $hBUF, $hBRU, $aBMP, $iCounter = 0, $yOffset = 0, $hBRU_Font, $hFON, $hFAM, $hFOR, $tRect
[/autoit] [autoit][/autoit] [autoit]$hGUI = GUICreate($sTitle, $iW, $iH)
_GDIPlus_Startup()
$hGFX = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hBMP = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGFX)
$hBUF = _GDIPlus_ImageGetGraphicsContext($hBMP)
$hBRU = _GDIPlus_BrushCreateSolid(0x05FFFFFF)
$hBRU_Font = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
$hFAM = _GDIPlus_FontFamilyCreate('Arial')
$hFON = _GDIPlus_FontCreate($hFAM, 16, 0, 2)
$hFOR = _GDIPlus_StringFormatCreate()
$tRect = _GDIPlus_RectFCreate(0, $iH/2 - $iLines * 11, $iW, $iH)
_GDIPlus_StringFormatSetAlign($hFOR, 1)
GUISetBkColor(0x000000, $hGUI)
GUIRegisterMsg(0xF, 'WM_PAINT')
GUISetState(@SW_SHOW, $hGUI)
OnAutoItExitRegister('_Free')
$aBMP = Frames()
[/autoit] [autoit][/autoit] [autoit]GUISetOnEvent(-3, '_Exit', $hGUI)
[/autoit] [autoit][/autoit] [autoit]While Sleep(30)
$iCounter += 1
$yOffset += $iH/40
If $iCounter = UBound($aBMP) Then $iCounter = 0
If $yOffset > $iH * 1.2 Then $yOffset = -$iH/5
_GDIPlus_GraphicsDrawImage($hBUF, $aBMP[$iCounter], 0, 0)
_GDIPlus_GraphicsFillRect($hBUF, 0, $yOffset, $iW, $iH/5, $hBRU)
WM_PAINT()
WEnd
Func WM_PAINT()
_GDIPlus_GraphicsDrawImage($hGFX, $hBMP, 0, 0)
EndFunc
Func Frames()
Local $a[$iFrames], $aBRU[8], $hTMP, $nHelligkeit = 4.25
For $i = 0 To UBound($aBRU) - 1 Step 1
$aBRU[$i] = _GDIPlus_BrushCreateSolid('0xFF' & Hex(Int($i*$nHelligkeit),2)& Hex(Int($i*$nHelligkeit),2)& Hex(Int($i*$nHelligkeit),2))
Next
For $i = 0 To $iFrames - 1 Step 1
$a[$i] = _GDIPlus_BitmapCreate($iW, $iH)
$hTMP = _GDIPlus_ImageGetGraphicsContext($a[$i])
For $x = 0 To $iW - 1 Step $iStep
For $y = 0 To $iH - 1 Step $iStep
DllCall($ghGDIPDll, "int", "GdipFillRectangleI", "handle", $hTMP, "handle", $aBRU[Random(0, 7, 1)], "int", $x, "int", $y, "int", $iStep, "int", $iStep)
Next
Next
_GDIPlus_GraphicsDrawStringEx($hTMP, $sText, $hFON, $tRect, $hFOR, $hBRU_Font)
_GDIPlus_GraphicsDispose($hTMP)
_GDIPlus_GraphicsDrawImage($hBUF, $a[$i], 0, 0)
WM_PAINT()
ToolTip(Round(($i+1)/$iFrames,2)*100 & '%')
Next
ToolTip('')
For $i = 0 To UBound($aBRU) - 1 Step 1
_GDIPlus_BrushDispose($aBRU[$i])
Next
Return $a
EndFunc
Func _Free()
For $i = 0 To UBound($aBMP) - 1 Step 1
_GDIPlus_BitmapDispose($aBMP[$i])
Next
_GDIPlus_GraphicsDispose($hBUF)
_GDIPlus_BitmapDispose($hBMP)
_GDIPlus_GraphicsDispose($hGFX)
_GDIPlus_BrushDispose($hBRU)
_GDIPlus_BrushDispose($hBRU_Font)
_GDIPlus_StringFormatDispose($hFOR)
_GDIPlus_FontDispose($hFON)
_GDIPlus_FontFamilyDispose($hFAM)
_GDIPlus_Shutdown()
EndFunc
Func _Exit()
Exit
EndFunc
Func ArrGetIndex($a, $i)
Return $a[$i]
EndFunc
Func _GDIPlus_BitmapCreate($iW, $iH)
Local $hGFX = _GDIPlus_GraphicsCreateFromHWND(_WinAPI_GetDesktopWindow())
Local $hBMP = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGFX)
_GDIPlus_GraphicsDispose($hGFX)
Return $hBMP
EndFunc
Viel Spaß