<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — How to fill the area between two circles?]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=605&amp;type=atom" />
	<updated>2017-02-22T10:02:02Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=605</id>
		<entry>
			<title type="html"><![CDATA[Re: How to fill the area between two circles?]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=2755#p2755" />
			<content type="html"><![CDATA[<p>Thank you jeff.</p>]]></content>
			<author>
				<name><![CDATA[EricE]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3718</uri>
			</author>
			<updated>2017-02-22T10:02:02Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=2755#p2755</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to fill the area between two circles?]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=2752#p2752" />
			<content type="html"><![CDATA[<p>Flood-filling circles can be problematic because of the nature how AppGraphics (or really any graphics library) draws circles.&nbsp; Often, like you&#039;ve witnessed, the circumference line is not continuous, allowing the flood fill to &quot;escape.&quot; </p><p>I would suggest perhaps using <em>fillellipse</em> instead to create an already-filled circle.&nbsp; To create the opposite effect for the inner circle, you could change the fill color and call <em>fillellipse</em> again.&nbsp; It would probably be more reliable than relying on a fill algorithm that is bound to be problematic whenever lines are not exactly horizontal or vertical.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2017-02-21T17:45:49Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=2752#p2752</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to fill the area between two circles?]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=2751#p2751" />
			<content type="html"><![CDATA[<p>Now this does work!<br />Any ideas why?<br />All I did was add an additional circle with radius=201.</p><p>Did the original outer circle (R=200) have some gaps that the second outer circle (R=201) closed?<br />Increasing R=201 to 202 and the program still works in filling in only the annular region, but at R=203 the code fails again and the color floods past the outermost circle</p><div class="codebox"><pre><code>!--------------------------------------------------------------------------------------
program main
use appgraphics
implicit none

    integer::myscreen
    myscreen = initwindow(800, 800,title=&#039;Graphics test 2&#039;,closeflag=.TRUE.)
    call setbkcolor(WHITE)
    call clearviewport()
    
    call setcolor(BLACK)
    call circle(300,300,100)
    call circle(300,300,200) 

    call circle(300,300,201)  
    
    call setfillstyle(SOLID_FILL, GREEN)
    call floodfill(300,450,BLACK)

    call loop()
    
    call closewindow(myscreen)
    
end program main
!--------------------------------------------------------------------------------------</code></pre></div>]]></content>
			<author>
				<name><![CDATA[EricE]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3718</uri>
			</author>
			<updated>2017-02-21T03:05:32Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=2751#p2751</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[How to fill the area between two circles?]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=2749#p2749" />
			<content type="html"><![CDATA[<p>I am trying to color fill the area between two concentric circles.</p><p>My code is below, but it does not work.<br />The color fill goes beyond the outer circle.</p><div class="codebox"><pre><code>!--------------------------------------------------------------------------------------
program main
use appgraphics
implicit none

    integer::myscreen
    myscreen = initwindow(800, 800,title=&#039;Graphics test 2&#039;,closeflag=.TRUE.)
    call setbkcolor(WHITE)
    call clearviewport()
    
    call setcolor(BLACK)
    call circle(300,300,100)     ! inner circle
    call circle(300,300,200)     ! outer circle
    
    call setfillstyle(SOLID_FILL, GREEN)
    call floodfill(300,450,BLACK)

    call loop()
    
    call closewindow(myscreen)
    
end program main
!--------------------------------------------------------------------------------------</code></pre></div>]]></content>
			<author>
				<name><![CDATA[EricE]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3718</uri>
			</author>
			<updated>2017-02-20T07:27:37Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=2749#p2749</id>
		</entry>
</feed>
