<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; GraphicsUtil</title>
	<atom:link href="http://blog.flexexamples.com/category/graphicsutil/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Drawing complex rectangles in Flex using the GraphicsUtil class</title>
		<link>http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/</link>
		<comments>http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/#comments</comments>
		<pubDate>Sun, 16 Sep 2007 07:25:12 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[GraphicsUtil]]></category>
		<category><![CDATA[drawRoundRectComplex()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/</guid>
		<description><![CDATA[<p>The following example shows how you can draw complex rectangles using the drawRoundRectComplex() method in the mx.utils.GraphicsUtil class.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/GraphicsUtil_drawRoundRectComplex_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init()"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.styles.StyleManager; import mx.utils.GraphicsUtil; private var fillColor:uint; private function init():void { fillColor = [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can draw complex rectangles using the <code>drawRoundRectComplex()</code> method in the mx.utils.GraphicsUtil class.</p>
<p>Full code after the jump.</p>
<p><span id="more-186"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/GraphicsUtil_drawRoundRectComplex_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init()"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.styles.StyleManager;
            import mx.utils.GraphicsUtil;

            private var fillColor:uint;

            private function init():void {
                fillColor = StyleManager.getColorName("haloOrange");

                box.graphics.clear();
                box.graphics.beginFill(fillColor);
                GraphicsUtil.drawRoundRectComplex(box.graphics,
                                                    0,
                                                    0,
                                                    box.width,
                                                    box.height,
                                                    topLeft.value,
                                                    topRight.value,
                                                    bottomLeft.value,
                                                    bottomRight.value);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form&gt;
            &lt;mx:FormItem label="topLeft:"&gt;
                &lt;mx:HSlider id="topLeft"
                        minimum="0"
                        maximum="{box.height / 2}"
                        snapInterval="1"
                        tickInterval="10"
                        liveDragging="true"
                        change="init();" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="topRight:"&gt;
                &lt;mx:HSlider id="topRight"
                        minimum="0"
                        maximum="{box.height / 2}"
                        snapInterval="1"
                        tickInterval="10"
                        liveDragging="true"
                        change="init();" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="bottomLeft:"&gt;
                &lt;mx:HSlider id="bottomLeft"
                        minimum="0"
                        maximum="{box.height / 2}"
                        snapInterval="1"
                        tickInterval="10"
                        liveDragging="true"
                        change="init();" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="bottomRight:"&gt;
                &lt;mx:HSlider id="bottomRight"
                        minimum="0"
                        maximum="{box.height / 2}"
                        snapInterval="1"
                        tickInterval="10"
                        liveDragging="true"
                        change="init();" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Box id="box" width="240" height="160" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/GraphicsUtil_drawRoundRectComplex_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/GraphicsUtil_drawRoundRectComplex_test/bin/main.html" width="100%" height="360"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Drawing complex rectangles in Flex using the GraphicsUtil class on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/',contentID: 'post-186',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'drawRoundRectComplex()',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

