Sign in to follow this  
Followers 0
BaKaMu

Mixed lines and rectangles with GUICtrlSetGraphic

2 posts in this topic

It is not possible to draw a line in front of a recangle, because lines are allways drawn first.

(Thank you <jpm> for explaining this behaviour)

See example

#include <GUIConstants.au3>

$GUIMain = GUICreate("GraphPlot", 400, 300, -1, -1)
GUISetState(@SW_SHOW)

$GraphCtrl = GUICtrlCreateGraphic(10, 10, 390, 290)

GUICtrlSetGraphic($GraphCtrl, $GUI_GR_PENSIZE, 10)

;draw blue rectangle filled with yellow
GUICtrlSetGraphic($GraphCtrl, $GUI_GR_COLOR, 0x0000FF, 0xFFFF00)
GUICtrlSetGraphic($GraphCtrl, $GUI_GR_RECT, 50, 50, 200, 100)
;GUICtrlSetGraphic($GraphCtrl, $GUI_GR_ELLIPSE, 50, 50, 200, 100)
;GUICtrlSetGraphic($GraphCtrl, $GUI_GR_PIE, 100, 150, 100, 70, -70)

;draw a green line
GUICtrlSetGraphic($GraphCtrl, $GUI_GR_COLOR, 0x00FF00)
GUICtrlSetGraphic($GraphCtrl, $GUI_GR_MOVE, 100, 0)
GUICtrlSetGraphic($GraphCtrl, $GUI_GR_LINE, 200, 200)

;show drawing
GUICtrlSetGraphic($GraphCtrl, $GUI_GR_REFRESH)

While 1
  $nMsg = GUIGetMsg()
  If $nMsg = $GUI_EVENT_CLOSE Then Exit
WEndoÝ÷ Ù8^·X§z+­¬'«-w(uæî¶+­¬'{ay¶
èºwh~Ø^­ç-jx%zØ^±©~Ü·%zƧv²[c¦h-«-¢Wfy¬(®F«¢éÝ~í+)®åzkajy2¢æ j)ÇzÇ©j¶­zËaz·µ©àë·%zƧv²èè+jbqÊ'¶º%jw]­¬,¶¥w¬¢v§¢Ø^®
Ú¦rí®l¢Ø^)Þ³¥·­¬'wë¢{h~Ø^­ç-jx%y«­¢+Ø¥¹±Õ±ÐíU%
½¹ÍѹÑ̹ÔÌÐì((ÀÌØíU%5¥¸ôU%
ÉÑ ÅÕ½ÐíÉÁ¡A±½ÐÅÕ½Ðì°ÐÀÀ°ÌÀÀ°´Ä°´Ä¤)U%MÑMÑÑ¡M]}M!=¤((ÀÌØíÉÁ¡
ÑÉ°ôU%
Ñɱ
ÉÑÉÁ¡¥ ÄÀ°ÄÀ°ÌäÀ°ÈäÀ¤()U%
ÑɱMÑÉÁ¡¥ ÀÌØíÉÁ¡
ÑÉ°°ÀÌØíU%}I}A9M%i°ÄÀ¤((íÉܱÕÉѹ±¥±±Ý¥Ñ å±±½Ü)U%
ÑɱMÑÉÁ¡¥ ÀÌØíÉÁ¡
ÑÉ°°ÀÌØíU%}I}
=1=H°ÁàÀÀÀÁ°ÁáÀÀ¤)U%
ÑɱMÑÉÁ¡¥ ÀÌØíÉÁ¡
ÑÉ°°ÀÌØíU%}I}I
P°ÔÀ°ÔÀ°ÈÀÀ°ÄÀÀ¤(íU%
ÑɱMÑÉÁ¡¥ ÀÌØíÉÁ¡
ÑÉ°°ÀÌØíU%}I}11%AM°ÔÀ°ÔÀ°ÈÀÀ°ÄÀÀ¤(íU%
ÑɱMÑÉÁ¡¥ ÀÌØíÉÁ¡
ÑÉ°°ÀÌØíU%}I}A%°ÄÀÀ°ÄÔÀ°ÄÀÀ°ÜÀ°´ÜÀ¤((í
ÉѹÜÉÁ¡¥½¹Ñɽ°½ÈÑ¡±¥¹(ÀÌØíÉÁ¡
ÑÉ°ÄôU%
Ñɱ
ÉÑÉÁ¡¥ ÄÀ°ÄÀ°ÌäÀ°ÈäÀ¤)U%
ÑɱMÑÉÁ¡¥ ÀÌØíÉÁ¡
ÑÉ°Ä°ÀÌØíU%}I}A9M%i°ÄÀ¤((íÉÜɸ±¥¹)U%
ÑɱMÑÉÁ¡¥ ÀÌØíÉÁ¡
ÑÉ°Ä°ÀÌØíU%}I}
=1=H°ÁàÀÁÀÀ¤)U%
ÑɱMÑÉÁ¡¥ ÀÌØíÉÁ¡
ÑÉ°Ä°ÀÌØíU%}I}5=Y°ÄÀÀ°À¤)U%
ÑɱMÑÉÁ¡¥ ÀÌØíÉÁ¡
ÑÉ°Ä°ÀÌØíU%}I}1%9°ÈÀÀ°ÈÀÀ¤(íU%
ÑɱMÑÉÁ¡¥ ÀÌØíÉÁ¡
ÑÉ°°ÀÌØíU%}I}
1=((íÍ¡½ÜÉÝ¥¹)U%
ÑɱMÑÉÁ¡¥ ÀÌØíÉÁ¡
ÑÉ°°ÀÌØíU%}I}IIM ¤()]¡¥±Ä(ÀÌØí¹5ÍôU%Ñ5Í ¤(%ÀÌØí¹5ÍôÀÌØíU%}Y9Q}
1=MQ¡¸á¥Ð)]¹oÝ÷ ØZ½çèºwZaz¼(®F«¢éÝ~槷µ©àëÙbë(Ø^±©¶©'¢{k¢T^rÖ§W¬q©ÛyÚÚÂv¬rZ,yÙbëY^vç¢×âW"{aDZæ¥w­¬'^¯«vÌ"VÞv¶°)ß®í¡ûaz·µ©à殶­sb6æ6ÇVFRfÇC´uT6öç7FçG2æS2fwC° ¢b33c´uTÖâÒuT7&VFRgV÷C´w&Æ÷BgV÷C²ÂCÂ3ÂÓÂÓ¤uT6WE7FFR5uõ4õr ¢b33c´w&7G&ÂÒuT7G&Ä7&VFTw&2ÂÂ3Â# ¤uT7G&Å6WDw&2b33c´w&7G&ÂÂb33c´uTôu%õTå4¤R £¶G&r&ÇVR&V7FævÆRfÆÆVBvFVÆÆ÷p¤uT7G&Å6WDw&2b33c´w&7G&ÂÂb33c´uTôu%ô4ôÄõ"ÂdbÂdddc¤uT7G&Å6WDw&2b33c´w&7G&ÂÂb33c´uTôu%ôÔõdRÂSÂS¤uT7G&Å6WDw&2b33c´w&7G&ÂÂb33c´uTôu%ôÄäRÂ#SÂS¤uT7G&Å6WDw&2b33c´w&7G&ÂÂb33c´uTôu%ôÄäRÂ#SÂS¤uT7G&Å6WDw&2b33c´w&7G&ÂÂb33c´uTôu%ôÄäRÂSÂS¤uT7G&Å6WDw&2b33c´w&7G&ÂÂb33c´uTôu%ôÄäR²b33c´uTôu%ô4Äõ4RÂSÂS·vÆÂÇ6òv÷&²vF÷WBb33c´uTôu%ô4Äõ4P £¶G&rw&VVâÆæP¤uT7G&Å6WDw&2b33c´w&7G&ÂÂb33c´uTôu%ô4ôÄõ"Âdc¤uT7G&Å6WDw&2b33c´w&7G&ÂÂb33c´uTôu%ôÔõdR¤uT7G&Å6WDw&2b33c´w&7G&ÂÂb33c´uTôu%ôÄäRÂ#Â# £·6÷rG&væp¤uT7G&Å6WDw&2b33c´w&7G&ÂÂb33c´uTôu%õ$Te$U4 ¥vÆR¢b33c¶ä×6rÒuTvWD×6r¢bb33c¶ä×6rÒb33c´uTôUdTåEô4Äõ4RFVâW@¥tVæ@

Unfortunately this is only a solution for rectangles and lines.

Next, if i have time, i will working on a solution for circles an pies.

I hope, this will be usefull for someone. :whistle:

Share this post


Link to post
Share on other sites



Thanks! I was just running into that this week while attempting to clear a graphic with a filled rectangle.

Dewclaws

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0