New topic: 

Concentric Circles

<http://forums.realsoftware.com/viewtopic.php?t=45124>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        DaveS          Post subject: Concentric CirclesPosted: Sun Aug 
26, 2012 12:16 pm                                 
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4033
Location: San Diego, CA                I cannot believe I can't figure this 
out... it should be so simple.

I need to draw a circle the is centered at X,Y and has a radius of R 

But the ring needs to be 5 pixels wide... with each ring being a different 
color.
Antialias has to be OFF... the ring must consist of ONLY the 3 colors I 
specifiy 

color1, color2, color3, color2, color1  (5 rings 3 colors).... where the center 
(color3 is the actual radius of "R" ..ie. the center color)

Since drawing Circles is imprecise on a pixel grid, and I do not want ANTIALIAS 
on.... I thought I would make 3 passes...  where the first pass was color1 with 
a penwidth/height of 5, the second pass was color2 with a pensize of 3, and 
finally penwidth of 1 with the 3rd color.   But they don't line up correctly
 Then I thought I would make 5 passes...  where each was Pensize of 1, but 
change the radius as well... but for some reason this drew a lopsided circle 
(as if the center point moved, which is doesnt)

I need a circle with a radius of 182 pixels (at the center color)

Any ideas... this should be Canvas Graphics 101...


here is my last attempt
r=182
g.AntiAlias=False
For i=-2 to 2
  Select Case i
  Case -2,2
  g.ForeColor=RGB(80,80,80)
  Case -1,1
  g.ForeColor=rgb(189,189,189)
  case 0
  g.ForeColor=rgb(166,166,166)
  end select
  g.PenWidth=2
  g.PenHeight=2
  g.drawoval (x-r),(y-r),(r*2)+i,(r*2)+i
next i
      
_________________
Dave Sisemore
MacPro, OSX 10.7.3 RB2011r3
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to