MadaraUchiha Posted December 9, 2013 Share Posted December 9, 2013 Hey, I tried drawing a line on my GUI like this: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <GDIPlus.au3> $Form1 = GUICreate("Form1", 404, 350, 192, 124) $Button1 = GUICtrlCreateButton("Go", 8, 8, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $Hwnd = WinGetHandle($Form1) _GDIPlus_Startup() $hGraphics = _GDIPlus_GraphicsCreateFromHWND($Hwnd) _GDIPlus_GraphicsDrawLine($hGraphics,50,50,50,50) EndSwitch WEnd But nothing happens? Why is that? ;o Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 9, 2013 Moderators Share Posted December 9, 2013 Your parameters for GraphicsDrawLine are incorrect. Try this: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <GDIPlus.au3> $Form1 = GUICreate("Form1", 404, 350, 192, 124) $Button1 = GUICtrlCreateButton("Go", 8,8,75,25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $Button1 _GDIPlus_Startup() $hGraphics = _GDIPlus_GraphicsCreateFromHWND($Form1) _GDIPlus_GraphicsDrawLine($hGraphics,10,150,390,150) EndSwitch WEnd MadaraUchiha 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
MadaraUchiha Posted December 9, 2013 Author Share Posted December 9, 2013 Yes, that works, but after minimizing and then restoring the GDI Stuff dissapeared from the GUI? How can I prevent this? Link to comment Share on other sites More sharing options...
AZJIO Posted December 10, 2013 Share Posted December 10, 2013 >GraphGDIPlus Maybe will help you understand Func _GraphGDIPlus_ReDraw($hWnd) ;----- Allows redraw of the GDI+ Image upon window min/maximize ----- _WinAPI_RedrawWindow($hWnd,0,0,0x0100) _GraphGDIPlus_Refresh($aGraphGDIPlusaGraphArrayINTERNAL) EndFunc My other projects or all Link to comment Share on other sites More sharing options...
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