<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.autoitscript.com/w/index.php?action=history&amp;feed=atom&amp;title=GUICtrlSetGraphic</id>
	<title>GUICtrlSetGraphic - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.autoitscript.com/w/index.php?action=history&amp;feed=atom&amp;title=GUICtrlSetGraphic"/>
	<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=GUICtrlSetGraphic&amp;action=history"/>
	<updated>2026-04-30T12:38:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=GUICtrlSetGraphic&amp;diff=11901&amp;oldid=prev</id>
		<title>Jaberwocky6669: Created page with &quot;&lt;!-- Autogenerated Wiki Page. --&gt; &lt;!-- Not meant to be user editable. --&gt; &lt;!-- If there is an error here then that means that there is an error in the helpfile. --&gt; &lt;!-- Repor...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=GUICtrlSetGraphic&amp;diff=11901&amp;oldid=prev"/>
		<updated>2013-08-23T04:35:09Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;!-- Autogenerated Wiki Page. --&amp;gt; &amp;lt;!-- Not meant to be user editable. --&amp;gt; &amp;lt;!-- If there is an error here then that means that there is an error in the helpfile. --&amp;gt; &amp;lt;!-- Repor...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- Autogenerated Wiki Page. --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Not meant to be user editable. --&amp;gt;&lt;br /&gt;
&amp;lt;!-- If there is an error here then that means that there is an error in the helpfile. --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Report it to Trac with category &amp;#039;Documentation&amp;#039;. --&amp;gt;&lt;br /&gt;
&amp;lt;!-- See this post for more info: http://www.autoitscript.com/forum/topic/153680-convert-helpfile-to-wiki-text/--&amp;gt;&lt;br /&gt;
&amp;lt;font face=&amp;#039;Segoe UI, Courier New, Lucida Grande, Verdana, Helvetica, sans-serif&amp;#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=&amp;#039;3&amp;#039; weight=&amp;#039;normal&amp;#039;&amp;gt;Modifies the data for a control.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;#039;Courier New&amp;#039;&amp;gt;&amp;lt;div id=&amp;#039;Syntax&amp;#039; style=&amp;#039;background-color:#FFFFAA;&amp;#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:GUICtrlSetGraphic ( controlID, type [, par1 [, ... par6]] )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;font size=4&amp;gt;&amp;lt;div id=&amp;#039;Section&amp;#039; style=&amp;#039;color:#DB7100;&amp;#039;&amp;gt;Parameters&amp;lt;/div&amp;gt;&amp;lt;/font&amp;gt;==&lt;br /&gt;
{| class=&amp;#039;wikitable&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| controlID || The control identifier (controlID) as returned by a [[GUICtrlCreateGraphic | GUICtrlCreateGraphic]] function.&lt;br /&gt;
|-&lt;br /&gt;
| type || type of drawing : dot, line, bezier, rect, ellipse, pie.&lt;br /&gt;
|-&lt;br /&gt;
| par1&amp;lt;nowiki&amp;gt;...&amp;lt;/nowiki&amp;gt;par6 || See the [[#Graphic_Type_table | Graphic Type table]] below.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;font size=4&amp;gt;&amp;lt;div id=&amp;#039;Section&amp;#039; style=&amp;#039;color:#DB7100;&amp;#039;&amp;gt;Return Value&amp;lt;/div&amp;gt;&amp;lt;/font&amp;gt;==&lt;br /&gt;
{| class=&amp;#039;wikitable&amp;#039;&lt;br /&gt;
| Success: || 	Returns 1.&lt;br /&gt;
|-&lt;br /&gt;
| Failure: || 	Returns 0.&lt;br /&gt;
|-&lt;br /&gt;
|  || Returns -1 in case of invalid data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;font size=4&amp;gt;&amp;lt;div id=&amp;#039;Section&amp;#039; style=&amp;#039;color:#DB7100;&amp;#039;&amp;gt;Remarks&amp;lt;/div&amp;gt;&amp;lt;/font&amp;gt;==&lt;br /&gt;
The point position (x,y) is relative to the [[GUICtrlCreateGraphic | GUICtrlCreateGraphic]] coordinates. It can be outside the graphic control but inside of the GUI window.&lt;br /&gt;
&lt;br /&gt;
==&amp;#039;&amp;#039;&amp;#039;Graphic Type table&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;#039;wikitable&amp;#039;&lt;br /&gt;
! | &amp;#039;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
! | &amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
! | &amp;#039;&amp;#039;&amp;#039;result&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_COLOR || Color [,BkColor] || Define the color of the next drawings. When BkColor is equal to $GUI_GR_NOBKCOLOR the drawing will not be filled. It is the default. For Color the default line color is black. &lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_MOVE || x,y || Move the current position without drawing. &lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_DOT || x,y || Draw a point(smallest square around the point), the next drawing will start from previous position. &lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_PIXEL || x,y || Draw a pixel, the next drawing will start from previous position. &lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_LINE || x,y || Draw a line. &lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_BEZIER || x,y,x1,y1,x2,y2 || Draw a bezier curve with 2 control points. &lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_RECT || x,y,w,h || Draw a rectangle. If w=h it will be a square. &lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_ELLIPSE || x,y,w,h || Draw an ellipse. If w=h it will be a circle. &lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_PIE || x,y,r,sa,wa || Draw a pie radius=r startangle=sa sweepangle=wa. Angles are in degrees. &lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_CLOSE || &amp;amp;nbsp; || to close the current drawing. It has to be added to $GUI_GR_LINE or $GUI_GR_BEZIER to close current drawing. Use alone will be ignored. &lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_REFRESH || &amp;amp;nbsp; || to force refresh after dynamic update of graphics. &lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_HINT || &amp;amp;nbsp; || to display control point and end point of bezier/line curve. &lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_PENSIZE || n || set pensize for the next drawings. It has to be defined before $GUI_GR_COLOR to be taken in account. &lt;br /&gt;
|-&lt;br /&gt;
| $GUI_GR_NOBKCOLOR || &amp;amp;nbsp; || is a dummy BkColor to force closed drawing not to be filled. Just line drawings. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Due to design constraints RECT, ELLIPSE and PIE graphics are drawn first.  For example, a LINE will always be drawn over a RECT.  If the drawing order is important to the look of the graphic, then it is recommended that multiple graphic controls be used instead of using a single control to do all the drawing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;font size=4&amp;gt;&amp;lt;div id=&amp;#039;Section&amp;#039; style=&amp;#039;color:#DB7100;&amp;#039;&amp;gt;Related&amp;lt;/div&amp;gt;&amp;lt;/font&amp;gt;==&lt;br /&gt;
[[GUICtrlCreateGraphic]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;font size=4&amp;gt;&amp;lt;div id=&amp;#039;Section&amp;#039; style=&amp;#039;color:#DB7100;&amp;#039;&amp;gt;Example&amp;lt;/div&amp;gt;&amp;lt;/font&amp;gt;==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;#039;autoit&amp;#039;&amp;gt;&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;StaticConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Global $MAXGr = 6, $del, $child&lt;br /&gt;
Global $a[$MAXGr + 1] ; 0 and $MAXGr entries not used to allow GUICtrlDelete result&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
	Local $msg, $inc, $i, $del1&lt;br /&gt;
&lt;br /&gt;
	GUICreate(&amp;quot;My Main&amp;quot;, -1, -1, 100, 100)&lt;br /&gt;
	$del1 = GUICtrlCreateButton(&amp;quot;Delete&amp;quot;, 50, 200, 50)&lt;br /&gt;
	GUISetState()&lt;br /&gt;
	CreateChild()&lt;br /&gt;
&lt;br /&gt;
	$i = 1&lt;br /&gt;
	$inc = 1&lt;br /&gt;
	;$i=5	; uncomment to delete starting from last define Graphic control&lt;br /&gt;
	;$inc=-1&lt;br /&gt;
&lt;br /&gt;
	Do&lt;br /&gt;
		$msg = GUIGetMsg()&lt;br /&gt;
		If $msg = $del1 Then $i = Del($inc)&lt;br /&gt;
&lt;br /&gt;
		If $msg = $del Then&lt;br /&gt;
			GUICtrlDelete($a[$i])&lt;br /&gt;
			$i = $i + $inc&lt;br /&gt;
			If $i &amp;lt; 0 Or $i &amp;gt; $MAXGr Then Exit&lt;br /&gt;
		EndIf&lt;br /&gt;
	Until $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&lt;br /&gt;
Func Del($iInc)&lt;br /&gt;
	GUIDelete($child)&lt;br /&gt;
	CreateChild()&lt;br /&gt;
	If $iInc = -1 Then Return 5&lt;br /&gt;
	Return 1&lt;br /&gt;
EndFunc   ;==&amp;gt;Del&lt;br /&gt;
&lt;br /&gt;
Func CreateChild()&lt;br /&gt;
	$child = GUICreate(&amp;quot;My Draw&amp;quot;)&lt;br /&gt;
	$del = GUICtrlCreateButton(&amp;quot;Delete&amp;quot;, 50, 165, 50)&lt;br /&gt;
&lt;br /&gt;
	$a[1] = GUICtrlCreateGraphic(20, 50, 100, 100)&lt;br /&gt;
	GUICtrlSetBkColor(-1, 0xffffff)&lt;br /&gt;
	GUICtrlSetColor(-1, 0)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000, 0xff0000)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_PIE, 50, 50, 40, 30, 270)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xffffff)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_PIE, 58, 50, 40, -60, 90)&lt;br /&gt;
&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 100, 100, 50, 80)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xc0c0ff)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_RECT, 350, 200, 50, 80)&lt;br /&gt;
	GUICtrlCreateLabel(&amp;quot;label&amp;quot;, 65, 100, 30)&lt;br /&gt;
	GUICtrlSetColor(-1, 0xff)&lt;br /&gt;
&lt;br /&gt;
	$a[2] = GUICtrlCreateGraphic(220, 10, 100, 100)&lt;br /&gt;
&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_PIE, 50, 50, 40, 30, 270)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xffffff)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_PIE, 58, 50, 40, -60, 90)&lt;br /&gt;
&lt;br /&gt;
	$a[3] = GUICtrlCreateGraphic(220, 110, 100, 100)&lt;br /&gt;
	GUICtrlSetBkColor(-1, 0xf08080)&lt;br /&gt;
	GUICtrlSetColor(-1, 0xff)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_HINT, 1)&lt;br /&gt;
&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff00)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_RECT, 50, 50, 80, 80)&lt;br /&gt;
&lt;br /&gt;
	$a[4] = GUICtrlCreateGraphic(20, 200, 80, 80)&lt;br /&gt;
	GUICtrlSetBkColor(-1, 0xffffff)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_HINT, 1)&lt;br /&gt;
&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 10, 10)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_LINE, 30, 40)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff00)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_LINE, 70, 70)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_LINE, 10, 50)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xffff00)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_LINE, 10, 10)&lt;br /&gt;
&lt;br /&gt;
	$a[5] = GUICtrlCreateGraphic(150, 10, 50, 50)&lt;br /&gt;
	GUICtrlSetBkColor(-1, 0xa0ffa0)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 20, 20) ; start point&lt;br /&gt;
	; it is better to draw line and after point&lt;br /&gt;
	; to avoid to switch color at each drawing&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x0000ff)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_DOT, 30, 30)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_LINE, 20, 40)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_DOT, 25, 25)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_LINE, 40, 40)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_DOT, 30, 40)&lt;br /&gt;
&lt;br /&gt;
	$a[6] = GUICtrlCreateGraphic(110, 260, 230, 130)&lt;br /&gt;
	GUICtrlSetColor(-1, 0) ; to display a black border line&lt;br /&gt;
	GUICtrlSetBkColor(-1, 0xc0c0ff)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_HINT, 3) ; to display control lines and end points&lt;br /&gt;
&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff); fill in blue&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 120, 20) ; start point&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_BEZIER, 120, 100, 200, 20, 200, 100)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_BEZIER + $GUI_GR_CLOSE, 100, 40, 40, 100, 40, 20)&lt;br /&gt;
	GUICtrlSetGraphic(-1, $GUI_GR_LINE, 60, 30) ; start point&lt;br /&gt;
&lt;br /&gt;
	GUISetState()&lt;br /&gt;
EndFunc   ;==&amp;gt;CreateChild&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>Jaberwocky6669</name></author>
	</entry>
</feed>