Thread: circle filling

  1. #1
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743

    Question circle filling

    Does anybody know of any circle filling algorithms that fade colors?

    I want to draw a filled in circle that in the center is white and fades to light blue and then fades to dark blue by the outer edge of the circle.

    I have an algorithm to draw a circle.....but I need some type of algorithm to fill a circle, especially the way I want to do it...and a circle filling algo is not near as easy as a rectangle filling algo....

    so anybody know of any?
    My Website

    "Circular logic is good because it is."

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    use for loops to test each possible bit to fill; all bits inside the circle, or maybe for simplicity's sake, in a rectangle which circumscribes your circle. find its distance from the center, and use that as a multiplier in your color code calculation. (smaller distance = brighter colors). if a point isn't inside the circle, don't plot any pixel.

    note: this may be slow. there might be a better way to do it.
    Last edited by ygfperson; 06-07-2002 at 07:15 PM.

  3. #3
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    Could you just use your circle drawing algorithm and from the center, draw bigger and bigger circles? As the number of circles increases, you can increment/decrement one of the RGB values. Not too sure how well this will work either.

  4. #4
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    you would think that....but that can leave out some pixels if you think about it....because it doesnt draw a perfect circle
    My Website

    "Circular logic is good because it is."

  5. #5
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    yea i agree with that,, I tried doing that.. But betwween each circle there are very small gaps(4 gaps).. On each corner..... And dosent look good.. But i think there are functions like fill etc etc.. So check them out

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. circle problem
    By gunghomiller in forum C++ Programming
    Replies: 10
    Last Post: 07-14-2007, 06:40 PM
  2. Drawing circle into a bitmap file
    By brokensail in forum C++ Programming
    Replies: 2
    Last Post: 10-30-2006, 01:26 AM
  3. Half of the circle
    By hdragon in forum Game Programming
    Replies: 14
    Last Post: 03-10-2006, 10:15 PM
  4. Filling up a circle
    By LowLife in forum C Programming
    Replies: 4
    Last Post: 01-21-2006, 04:52 PM
  5. point lies in circle?
    By cozman in forum Game Programming
    Replies: 3
    Last Post: 12-20-2001, 04:39 PM