ACalcutt Posted September 6, 2007 Share Posted September 6, 2007 Does anyone know how to delete all data that was drawn into a GUICtrlCreateGraphic? I am graphing data and would like clear the graphic window every cycle so it can redraw the changing data. I had this sort of working by deleting the control and recreating the GUICtrlCreateGraphic control, but there must be a better way to do this, and i don't think it would work with my current GUI -Andrew Andrew Calcutt Http://www.Vistumbler.net Http://www.TechIdiots.net Its not an error, its a undocumented feature Link to comment Share on other sites More sharing options...
JustinReno Posted September 6, 2007 Share Posted September 6, 2007 I'm not sure if this is correct but: CODE guictrlsetdata($MyGraphicPic, "") Link to comment Share on other sites More sharing options...
ACalcutt Posted September 6, 2007 Author Share Posted September 6, 2007 I'm not sure if this is correct but:CODEguictrlsetdata($MyGraphicPic, "")no, that doesn't work Andrew Calcutt Http://www.Vistumbler.net Http://www.TechIdiots.net Its not an error, its a undocumented feature Link to comment Share on other sites More sharing options...
ACalcutt Posted October 9, 2007 Author Share Posted October 9, 2007 Anyone know? Andrew Calcutt Http://www.Vistumbler.net Http://www.TechIdiots.net Its not an error, its a undocumented feature Link to comment Share on other sites More sharing options...
gsglive Posted October 9, 2007 Share Posted October 9, 2007 Try GuiCtrlSetImage($MyGraphic, "") - gsglive - gsglive Link to comment Share on other sites More sharing options...
smashly Posted October 9, 2007 Share Posted October 9, 2007 Hi,#include <GUIConstants.au3> Global $Graphic $Gui = GUICreate(";-)", 120, 140) $Button = GUICtrlCreateButton("Delete Graphic", 15,115, 90, 20) Graphic() GUISetState(@SW_SHOW, $Gui) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button If $Graphic <> 0 Then GUICtrlDelete($Graphic) GUICtrlSetData($Button, "Create Graphic") $Graphic = 0 Else Graphic() GUICtrlSetData($Button, "Delete Graphic") EndIf EndSelect WEnd Func Graphic() $Graphic = GuiCtrlCreateGraphic(10, 10, 100,100) GUICtrlSetBkColor(-1,0xffffff) GUICtrlSetColor(-1,0) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xff0000,0xff0000) GUICtrlSetGraphic(-1,$GUI_GR_PIE, 50,50, 40,30,270) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x00ff00,0xffffff) GUICtrlSetGraphic(-1,$GUI_GR_PIE, 58,50, 40,-60,90) GUICtrlSetState(-1, $GUI_SHOW) EndFunc Cheers Link to comment Share on other sites More sharing options...
ACalcutt Posted November 4, 2007 Author Share Posted November 4, 2007 Hi,#include <GUIConstants.au3> Global $Graphic $Gui = GUICreate(";-)", 120, 140) $Button = GUICtrlCreateButton("Delete Graphic", 15,115, 90, 20) Graphic() GUISetState(@SW_SHOW, $Gui) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button If $Graphic <> 0 Then GUICtrlDelete($Graphic) GUICtrlSetData($Button, "Create Graphic") $Graphic = 0 Else Graphic() GUICtrlSetData($Button, "Delete Graphic") EndIf EndSelect WEnd Func Graphic() $Graphic = GuiCtrlCreateGraphic(10, 10, 100,100) GUICtrlSetBkColor(-1,0xffffff) GUICtrlSetColor(-1,0) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xff0000,0xff0000) GUICtrlSetGraphic(-1,$GUI_GR_PIE, 50,50, 40,30,270) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x00ff00,0xffffff) GUICtrlSetGraphic(-1,$GUI_GR_PIE, 58,50, 40,-60,90) GUICtrlSetState(-1, $GUI_SHOW) EndFunc Cheers Is there any way to do it without deleting the graphic? I am deleting it now, but when my graph gets big you can set the flash of the graph deleting and recreating itself. Its a little annoying Andrew Calcutt Http://www.Vistumbler.net Http://www.TechIdiots.net Its not an error, its a undocumented feature 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