PDA

View Full Version : circle filling



DavidP
06-07-2002, 04:02 PM
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?

ygfperson
06-07-2002, 07:12 PM
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.

golfinguy4
06-07-2002, 09:06 PM
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.

DavidP
06-07-2002, 09:32 PM
you would think that....but that can leave out some pixels if you think about it....because it doesnt draw a perfect circle

vasanth
06-08-2002, 05:37 AM
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