Szhlopp Posted July 29, 2008 Posted July 29, 2008 (edited) Fixed. This repaints the image correctly=) expandcollapse popup#include <GDIPLUS.au3> _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\Clock_Blank.jpg') $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage) $backgroundimage = _GDIPlus_BitmapCreateFromGraphics(400, 150, $hGraphic) $background = _GDIPlus_ImageGetGraphicsContext($backgroundimage) $hFamily = _GDIPlus_FontFamilyCreate ("Britannic Bold") $hFont = _GDIPlus_FontCreate($hFamily, 20, 1) $tLayout = _GDIPlus_RectFCreate (104, 48, 400, 60) $hFormat = _GDIPlus_StringFormatCreate(0) $hBrush = _GDIPlus_BrushCreateSolid(0xA7FFFFFF) Do _GDIPlus_GraphicsClear($background, 0xFF000000) _GDIPlus_GraphicsDrawImageRect($background, $hImage,0,0, 400, 150) $time = @HOUR & ":" & @MIN if @HOUR >= 13 then $tLayout = _GDIPlus_RectFCreate (122, 48, 400, 60) $time = @HOUR - 12 & ":" & @MIN EndIf _GDIPlus_GraphicsDrawStringEx($background, $time, $hFont, $tLayout, $hFormat, $hBrush) _GDIPlus_ImageSaveToFile($backgroundimage, @ScriptDir & '\Clocktest.jpg') Sleep(3000) until False Func OnAutoItExit ( ) _GDIPlus_Shutdown() EndFunc Edited July 29, 2008 by Szhlopp RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+'
Szhlopp Posted July 29, 2008 Author Posted July 29, 2008 Any help? I can re-read the image from the file, but I don't want to constantly do this. I just want to be able to clear what ever I've painted on the screen and then re-draw everything. RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+'
weaponx Posted July 29, 2008 Posted July 29, 2008 Why do you even need to call _GDIPlus_GraphicsClear? You are redrawing everything over it anyways.
Szhlopp Posted July 29, 2008 Author Posted July 29, 2008 Why do you even need to call _GDIPlus_GraphicsClear? You are redrawing everything over it anyways.Because I wasn't clearing it and it was layering when the time changed.I fixed it. Thanks thoughCreated a seperate 'Layer' to work on with the text, it works fine now=) RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+'
weaponx Posted July 29, 2008 Posted July 29, 2008 Well don't delete your original question, it helps others in the future to see your solution.
Szhlopp Posted July 29, 2008 Author Posted July 29, 2008 Well don't delete your original question, it helps others in the future to see your solution.Sorry lolI'll update the title with fixed and repost the solution=) RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+'
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