Aceguy Posted September 5, 2008 Posted September 5, 2008 #include <GuiConstantsEx.au3> #include <GDIPlus.au3> $y=150 Local $hGUI, $hWnd, $hGraphic, $hPen ; Create GUI $hGUI = GUICreate("GDI+", 400, 300) $hWnd = WinGetHandle("GDI+") GUISetState() ; Draw line _GDIPlus_Startup () $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd) $hPen = _GDIPlus_PenCreate () _GDIPlus_GraphicsDrawLine ($hGraphic, 10, $y, 390, 150, $hPen) ; Loop until user exits for $y=150 to 200 _GDIPlus_GraphicsDrawLine ($hGraphic, 10, $y, 390, 150, $hPen) sleep(250) next sleep(5000) ; Clean up resources _GDIPlus_PenDispose ($hPen) _GDIPlus_GraphicsDispose ($hGraphic) _GDIPlus_Shutdown ()# how do i destroy the previous line.? so only 1line is displayed (moving) [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
monoceres Posted September 5, 2008 Posted September 5, 2008 _GDIPlus_graphicsClear Broken link? PM me and I'll send you the file!
Aceguy Posted September 5, 2008 Author Posted September 5, 2008 does not work. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Malkey Posted September 5, 2008 Posted September 5, 2008 #include <GuiConstantsEx.au3> #include <GDIPlus.au3> $y=150 Local $hGUI, $hWnd, $hGraphic, $hPen ; Create GUI $hGUI = GUICreate("GDI+", 400, 300) $hWnd = WinGetHandle("GDI+") GUISetState() ; Draw line _GDIPlus_Startup () $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd) $hPen = _GDIPlus_PenCreate () _GDIPlus_GraphicsDrawLine ($hGraphic, 10, $y, 390, 150, $hPen) ; Loop until user exits for $y=150 to 200 _GDIPlus_GraphicsDrawLine ($hGraphic, 10, $y, 390, 150, $hPen) sleep(250) next sleep(5000) ; Clean up resources _GDIPlus_PenDispose ($hPen) _GDIPlus_GraphicsDispose ($hGraphic) _GDIPlus_Shutdown ()# how do i destroy the previous line.? so only 1line is displayed (moving) Use _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), "", "", BitOR($RDW_INVALIDATE, $RDW_UPDATENOW, $RDW_FRAME, $RDW_ALLCHILDREN)) Originally from http://www.autoitscript.com/forum/index.ph...st&p=560052 A good post explaining its use is here http://www.autoitscript.com/forum/index.ph...st&p=570134 The _AntiAlias( ) function from here http://www.autoitscript.com/forum/index.ph...st&p=557051 You may or may not find graphic improvement using AntiAlias. expandcollapse popup#include <GuiConstantsEx.au3> #include <GDIPlus.au3> #include <WindowsConstants.au3> $y = 150 Local $hGUI, $hWnd, $hGraphic, $hPen ; Create GUI $hGUI = GUICreate("GDI+", 400, 300) $hWnd = WinGetHandle("GDI+") GUISetState() ; Draw line _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd) $hPen = _GDIPlus_PenCreate(0xFF000000, 2) _GDIPlus_GraphicsDrawLine($hGraphic, 10, $y, 390, 150, $hPen) _AntiAlias($hGraphic) ; Loop until user exits For $y = 150 To 200 _GDIPlus_GraphicsDrawLine($hGraphic, 10, $y, 390, 150, $hPen) Sleep(250) _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), "", "", BitOR($RDW_INVALIDATE, $RDW_UPDATENOW, $RDW_FRAME, $RDW_ALLCHILDREN)) Next Sleep(5000) ; Clean up resources _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Func _AntiAlias($hGraphics) Local $aResult $aResult = DllCall($ghGDIPDll, "int", "GdipSetSmoothingMode", "hwnd", $hGraphics, "int", 2) If @error Then Return SetError(@error, @extended, False) Return SetError($aResult[0], 0, $aResult[0] = 0) EndFunc ;==>_AntiAlias
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