nacerbaaziz Posted May 8, 2020 Posted May 8, 2020 hello autoit team please i've a question for you. am creating a audio player and in this audio player i want to show the current trac info such as the total time and the position ... etc i know i can show it as label but the screen reader for the blind read the text every change because it have a screen scan what i want is to show this informations but such image or icon i mean i need to create GUICtrlCreatepic or GUICtrlCreateicon .... or some thing as that and show this informations as image on it i think that i can do that with the _GDIPlus functions but i couldn't find the currect way to do it i tried the _GDIPlus_GraphicsDrawString but i couldn't know how it work what i need is a small example that create a GUI and add a multy line text to it as graphic or image. so i need a simple way because it will changed every sec i hope any one can help me to do that global $GUI = GUICreate("text", 400, 400) global $label = GUICtrlCreateLabel(GetText(), 10, 10, 380, 380) GUISetState() do sleep(100) until GUIGetMSG() = -3 exit func GetText() return StringFormat("file name is test.mp3 \r\n total time is 00:30:00 \r\n position is 00:05:50") endFunc
genius257 Posted May 8, 2020 Posted May 8, 2020 Hi @nacerbaaziz Something like this? expandcollapse popup#include <GDIPlus.au3> Opt("GuiOnEventMode", 1) $bRun = True $iIndex = 0 Global $aTexts = ["Hello world"&@CRLF&"This is a test", "easy"&@CRLF&"peacy", "third"&@CRLF&"option"] $hWnd = GUICreate("", 700, 320) GUISetState(@SW_SHOW, $hWnd) GUISetOnEvent(-3, "MyExit", $hWnd) $iLabel = GUICtrlCreateLabel("", 10, 10, 380, 100) GUICtrlSetBkColor($iLabel, 0xFFFF0000) _GDIPlus_Startup() ;MsgBox(0, "", GUICtrlGetHandle($iLabel)) $hGraphics = _GDIPlus_GraphicsCreateFromHWND(GUICtrlGetHandle($iLabel)) ;$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd) $hBrush = _GDIPlus_BrushCreateSolid(0x7F00007F) $hFormat = _GDIPlus_StringFormatCreate() $hFamily = _GDIPlus_FontFamilyCreate("Arial") $hFont = _GDIPlus_FontCreate($hFamily, 12, 2) $tLayout = _GDIPlus_RectFCreate(0, 0, 100, 200) $hTimer = TimerInit() While $bRun Sleep(10) If TimerDiff($hTimer) > 1000 Then $hTimer = TimerInit() $iIndex = Mod($iIndex + 1, UBound($aTexts)) _GDIPlus_GraphicsClear($hGraphics, 0xFF000000) _GDIPlus_GraphicsDrawStringEx($hGraphics, $aTexts[$iIndex], $hFont, $tLayout, $hFormat, $hBrush) EndIf WEnd _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() Func MyExit() $bRun = False EndFunc To show your appreciation My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser
nacerbaaziz Posted May 9, 2020 Author Posted May 9, 2020 that exactly what i need to. thank you sir. wish you good time
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now