Jump to content

Draw floating text


Recommended Posts

To be able to tell you how you did it previously would mean we'd need access to every script you ever wrote.

I'm sure you think that's a reasonable request... >_<

Anyway, on behalf of the rest of the members who attempted to help, apology(?) accepted :(

Edit: Damnit, on post #8 I hit the plus reputation button when I meant to hit the MultiQuote...

As I said before, I only used functionality provided in the default AutoIt installation, and that it took 1 or 2 lines. You wouldn't need to have every script I've ever made... The code is already there, I just can't find it again.

And the rep thing, that's just your subconscious screaming how cool you think I am... o.O

Link to comment
Share on other sites

  • 7 years later...
On 8/1/2009 at 11:29 PM, Malkey said:

This draws text to screen without a GUI.

 

;
#include <GDIPlus.au3>
#include <WinAPI.au3>

Opt("GUIOnEventMode", 1) ;0=disabled, 1=OnEvent mode enabled
HotKeySet("{ESC}", "_Quit")
Global $GuiSizeX = @DesktopWidth, $GuiSizeY = @DesktopHeight

Local $hGui = ControlGetHandle("Program Manager", "", "SysListView321");GUICreate("GDIPlus Example", $GuiSizeX, $GuiSizeY)
;GUISetState()

_GDIPlus_Startup()

Local $hGraphicGUI = _GDIPlus_GraphicsCreateFromHWND($hGui)
Local $hBMPBuff = _GDIPlus_BitmapCreateFromGraphics($GuiSizeX, $GuiSizeY, $hGraphicGUI)
Local $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBMPBuff)

;Graphics here
_GDIPlus_GraphicsClear($hGraphic, 0x00E8FFE8)

_GDIPlus_GraphicsDrawString($hGraphic, "Hello world", 600, 420)
;End of graphics

_GDIPlus_GraphicsDrawImage($hGraphicGUI, $hBMPBuff, 0, 0)
;End Double Buffer add-on 2 of 3

While 1
    _GDIPlus_GraphicsDrawImage($hGraphicGUI, $hBMPBuff, 0, 0)
    Sleep(20)
WEnd

Func _Quit()
    ;_GDIPlus_BrushDispose($hBrush)
    ;_GDIPlus_PenDispose($hPen)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_GraphicsDispose($hGraphicGUI)
    _WinAPI_DeleteObject($hBMPBuff)
    _GDIPlus_Shutdown()
    Exit
EndFunc   ;==>_Quit
;

this works for me but now ive tried editing the code and cant find where to make the text bigger and change color.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...