forever Posted May 4, 2006 Share Posted May 4, 2006 i have this:GuiCtrlCreateGraphic(220, 50, 100,100) GUICtrlSetBkColor(-1,0xffffff) GUICtrlSetColor(-1,0) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x005000,0x005000) GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, 10,24, 80,30) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x005000,0x005000) GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, 10,27, 80,30) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x005000,0x005000) GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, 10,29, 80,30) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x008000,0x008000) GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, 10,20, 80,30)..and i need this: (ms painted!)can any1 help? Link to comment Share on other sites More sharing options...
jpm Posted May 4, 2006 Share Posted May 4, 2006 I assume you need to use $GUI_GR_PIE Link to comment Share on other sites More sharing options...
nfwu Posted May 4, 2006 Share Posted May 4, 2006 (edited) Ok, I'll work with a flat pie first, then I'll go look up some of my translation functions, then come back to you. FLAT VERSION:(Demo of 2 methods)expandcollapse popup#include <GUIConstants.au3> GUICreate("zzz", 500, 500) GUICtrlCreateGraphic(0,0) ;;; Lazy method GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x005000,0x005000) ;; xlocation, ylocation, radius, startsweep, endsweep GUICtrlSetGraphic ( -1, $GUI_GR_PIE, 100, 100, 50, 0, 360) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xFFFFFF,0xFFFFFF) ;; xlocation, ylocation, radius, startsweep, endsweep GUICtrlSetGraphic ( -1, $GUI_GR_PIE, 100, 100, 50, 0,50) GUICtrlSetGraphic(-1, $GUI_GR_CLOSE) ;;Trig Metod 3 GUICtrlCreateGraphic(0,0) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x005000,0x005000) ;; x,y,w,h GUICtrlSetGraphic ( -1, $GUI_GR_ELLIPSE, 150, 50, 100, 100) GUICtrlSetGraphic(-1, $GUI_GR_CLOSE) GUICtrlCreateGraphic(100,200) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xFFFFFF,0xFFFFFF) GUICtrlSetGraphic(-1, $Gui_GR_MOVE, 0,0) _CreatePieSector(0, 80, 50, +1) Func _CreatePieSector($start, $end, $radius, $step=+1) $degtorad=3.14159265358979/180 For $i = $start to $end Step $step GUICtrlSetGraphic(-1, $GUI_GR_LINE, Cos($i*$degtorad)*$radius, Sin($i*$degtorad)*$radius) Next GUICtrlSetGraphic(-1, $GUI_GR_CLOSE) EndFunc GUICtrlSetData(-1, $GUI_GR_REFRESH) GUISetState() while GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Exit #) Edited May 4, 2006 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
nfwu Posted May 4, 2006 Share Posted May 4, 2006 (edited) Ahhh!!!! YES!!!! Completed 3D version: #include <GUIConstants.au3> GUICreate("zzz", 500, 500) GuiCtrlCreateGraphic(220, 50, 100,100) GUICtrlSetBkColor(-1,0xffffff) GUICtrlSetColor(-1,0) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x005000,0x005000) GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, 10,24, 80,30) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x005000,0x005000) GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, 10,27, 80,30) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x005000,0x005000) GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, 10,29, 80,30) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x008000,0x008000) GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, 10,20, 80,30) GuiCtrlCreateGraphic(220+10+40, 50+20+15) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x888888,0x888888) _CreatePieSector2(InputBox("Test Demo", "Enter Starting Angle"), InputBox("Test Demo", "Enter Ending Angle"), 40, 15) Func _CreatePieSector2($start, $end, $rw, $rh, $step=+1) $degtorad=3.14159265358979/180 For $i = $start to $end Step $step GUICtrlSetGraphic(-1, $GUI_GR_LINE, Cos($i*$degtorad)*$rw, Sin($i*$degtorad)*$rh) Next GUICtrlSetGraphic(-1, $GUI_GR_CLOSE) EndFunc GUICtrlSetGraphic(-1, $GUI_GR_REFRESH) GUISetState() while GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Exit #) edit: mistake on line 15 of code. edit: thanks for pointing out my error about GUICtrlSetGraphic(-1, $GUI_GR_REFRESH) Edited May 12, 2006 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
forever Posted May 4, 2006 Author Share Posted May 4, 2006 (edited) Works nice. Thanks! i knew that i had to use pie somehow - the prob was i could only do a flat version (2d) and that wasnt what i wanted now the 3d thingie from nfwu is very nice!For People who want to use it too:Replace this line GUICtrlSetData(-1, $GUI_GR_REFRESH) on the very end of nfwu's scriptwith this one GUICtrlSetGraphic(-1, $GUI_GR_REFRESH) Edited May 8, 2006 by forever 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