How i implement Mid-Point/Bresenham circle algorithm in objective-C?
I want to implement mid-point/Bresenham circle drawing algorithm using objective for Iphone.please give me any tutorial or source code to drawing mid point/Bresenham circle algorithm.It 开发者_如何学JAVAis possible to draw the circle using CGPoint method?
That algorithm appears to be well documented on Wikipedia, however, since it is about where to put the dots to create the circle, I have to point out the answers to this Stack Overflow question. Short summary: Core Graphics isn't pixel oriented.
So if you want to draw the circle point-by-point yourself, look at the answers for the linked question, and apply that to the algorithm from Wikipedia. If you just want to draw a circle, refer to the documentation, esp. CGContextAddEllipseInRect
.
精彩评论