Sign in to follow this  
Followers 0
CodeTinkerer

GDI Draw String, Move.

1 post in this topic

Hello Again,

So this time around with GDI Im trying to get a text with a transparent background (And none of that white outline around the text either) and have it move from left to right, or right to left.

 

This script I found gives me the desired text rendering, no outline no background, now How would I go about moving the string around?

#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
HotKeySet("{ESC}", "Terminate")
Global $hGUI=0,$bRunning=True
Example()

Func Example()
 $hGUI = GUICreate("GDI+ test", 800, 400,-1,-1,$WS_POPUP,$WS_EX_LAYERED)
GUISetBkColor(0xABCDEF)
_WinAPI_SetLayeredWindowAttributes($hGUI,0xABCDEF)
GUISetState()
 _GDIPlus_Startup()

    If @OSBuild < 6000 Then MsgBox($MB_SYSTEMMODAL, "", "Antialiasing is automatically turned on for your operating system - no visible differences!")


    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    _GDIPlus_GraphicsDrawString($hGraphics, "AutoIt rulez!", 0, 0, "Impact", 110)

    While $bRunning
      Sleep(10)
    WEnd

    ;cleanup resources
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
EndFunc   ;==>Example

Func Terminate()
    $bRunning=False
EndFunc

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0