FloodFill on iPhone

I am very new to iPhone development. I want to create an application that uses the FloodFill algorithm on the iPhone. I have no idea about FloodFill. Explain to me the purpose of the FloodFill algorithm. If you give an example application for FloodFill (iPhone), then I'm really happy. Because I’ve been studying FloodFill since morning, but haven’t found anything.

My task: I want to fill the image with color as part in parts. This means that if I select one color and click on a specific area of ​​the image, then it is painted in the selected color.

Please help me do this.

Edit: I cannot write code to implement the fill algorithm for the iPhone.

+5
source share
3 answers

, , .

. (, , , ). , , , , , .

, . , X - . , 7,0 - . ( )!

 01234567
0........
1.XXXX...
2.X..X...
3.X...X..
4.XXX..X.
5...X..X.
6...XXX..
7........

, 3,3. 3,3 . , , , . up (3,2), (), . down (3,4) , . , (2,3) (4,3) (), .

, - O, :

 01234567
0........
1.XXXX...
2.X.OX...
3.XOOOX..
4.XXX..X.
5...X..X.
6...XXX..
7........

"" (3,2). X, . X, , - O, , (2,2) (), .

, "" (4,3). , , - (4,4). :

 01234567
0........
1.XXXX...
2.XOOX...
3.XOOOX..
4.XXXO.X.
5...X..X.
6...XXX..
7........

, (4,4), . (5,5). .

:)

+6

. :

  • ? - Even/Odd, ( Bézier)?

  • " "? " ", (, , , ) ( , MacPaint/Deluxe Paint). 2D- , "", "" ( "", , ), / (, PhotoShop).

, , ... , , , , .

, # 1 , , . Mac OS X/iOS 2D- API, PDF/PostScript. CoreGraphics/Quartz " ", .

# 2 , , . , , . , OpenGL + , , "" . , , , , , , , .

CoreGraphics OpenGL - , , , CoreGraphics OpenGL API- . CoreGraphics API , API CoreGraphics ( , iOS, ).

+3

You must follow the program to write your own implementations.

Hope this helps.

+2
source