#include <GUIConstants.au3>
#include <GDIplus.au3>
#include <file.au3>
#include <Array.au3>
HotKeySet("{ESC}", "xx")
;FileInstall("OmH.txt", "*")
; FileInstall("black.jpg", "*")
;Global $aRecords
Global $graphics, $bitmap, $backbuffer, $hGUI, $hBrush1, $hBrush2,$hBrush3,$hBrush4,$hBrush5
Global $Width = 1100, $Height = 55
Global $hFormat, $hFamily, $hFont, $text_color, $tLayout
Global $hShadowBrush, $hShadowFormat, $hShadowFamily, $hShadowFont
Global $letter_distance, $Length, $scroller_length,$ioffset,$monic1nik1
Global $font_size = 20,$text
;_FileReadToArray('OmH.txt', $aRecords)
;_ArrayDelete($aRecords, 0)
;$text = _ArrayToString($aRecords, ' ')
Opt('GUIOnEventMode', 1)
$hwnd = GUICreate('GDI+', $Width, $Height)
;$monic1nik1 = GuiCtrlCreatePic("black.jpg", 0, 0, 1100, 55)
GUISetBkColor(0x000000)
GUISetOnEvent($GUI_EVENT_CLOSE, 'close')
GUISetState()
$text = 'Очень качественный пример "бегущей строки" в окне GUI ! :)'
_GDIPlus_Startup()
$text_color =0x1ce4f8
$fon_color1=0x131313
$fon_color2=0x090909
$fon_color3=0x000000
$fon_color4=0x090909
$fon_color5=0x131313
$fon_color1='0xFF'&Hex($fon_color1,6)
$fon_color2='0xFF'&Hex($fon_color2,6)
$fon_color3='0xFF'&Hex($fon_color3,6)
$fon_color4='0xFF'&Hex($fon_color4,6)
$fon_color5='0xFF'&Hex($fon_color5,6)
$text_color = '0xFF'&Hex($text_color,6)
$htextBrush = _GDIPlus_BrushCreateSolid($text_color)
$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate('Arial')
$hFont = _GDIPlus_FontCreate($hFamily, $font_size, 2)
$tLayout = _GDIPlus_RectFCreate(0, 0)
$hShadowFormat = _GDIPlus_StringFormatCreate()
$hShadowFamily = _GDIPlus_FontFamilyCreate('Arial')
$hShadowFont = _GDIPlus_FontCreate($hShadowFamily, $font_size, 2)
_GDIPlus_GraphicsSetSmoothingMode($backbuffer, 2)
$graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
$bitmap = _GDIPlus_BitmapCreateFromGraphics($Width, $Height, $graphics)
$backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
$hBrush1 = _GDIPlus_BrushCreateSolid($fon_color1)
$hBrush2 = _GDIPlus_BrushCreateSolid($fon_color2)
$hBrush3 = _GDIPlus_BrushCreateSolid($fon_color3)
$hBrush4 = _GDIPlus_BrushCreateSolid($fon_color4)
$hBrush5 = _GDIPlus_BrushCreateSolid($fon_color5)
$letter_distance = $font_size
$Length = $font_size * 1.666 * 0.36
$cc = $Width
$scroller_length = StringLen($text) * $Length
$FontY = $Height - $font_size * 2.2
AdlibRegister('ScrollText',50)
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
Func ScrollText()
For $ioffset = -200 to 0 step 5
_GDIPlus_GraphicsFillRect($backbuffer, 0, 8, 1100, 7, $hBrush1)
_GDIPlus_GraphicsFillRect($backbuffer, 0, 15, 1100, 7, $hBrush2)
_GDIPlus_GraphicsFillRect($backbuffer, 0, 22, 1100, 9, $hBrush3)
_GDIPlus_GraphicsFillRect($backbuffer, 0, 31, 1100, 7, $hBrush4)
_GDIPlus_GraphicsFillRect($backbuffer, 0, 38, 1100, 7, $hBrush5)
$FontX = $cc + $letter_distance
DllStructSetData($tLayout, 'x', $FontX)
DllStructSetData($tLayout, 'y', $FontY)
_GDIPlus_GraphicsDrawStringEx($backbuffer, $text, $hFont, $tLayout, $hFormat, $htextBrush)
$cc -= 1
If - $scroller_length >= $cc + $Width Then $cc = $Width
Sleep(33)
_GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $Width, $Height)
_GDIPlus_GraphicsSetSmoothingMode($backbuffer, 2)
Next
EndFunc
AdlibUnRegister('ScrollText')
Func close()
_GDIPlus_BrushDispose($htextBrush)
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_BrushDispose($hShadowBrush)
_GDIPlus_FontDispose($hShadowFont)
_GDIPlus_FontFamilyDispose($hShadowFamily)
_GDIPlus_StringFormatDispose($hShadowFormat)
_GDIPlus_BrushDispose($hBrush1)
_GDIPlus_BrushDispose($hBrush2)
_GDIPlus_BrushDispose($hBrush3)
_GDIPlus_BrushDispose($hBrush4)
_GDIPlus_BrushDispose($hBrush5)
_GDIPlus_GraphicsDispose($graphics)
_GDIPlus_Shutdown()
Exit
EndFunc
Func xx()
Sleep (300)
Exit
EndFunc