Reputation: 51
i am developing a iphone app. i have a background image lets say an airplane with black color out lines and from color palette user can pick a color and fill the region of airplane....any help, code , suggestion will highly be appriciated
Upvotes: 1
Views: 1654
Reputation: 5599
My first though was to have a UIView and a mask image on top of that with the plane but this only works in certain situations. If the shape of the plane does not change you could also change the color and then "fill" the plan in during the drawRect using functions like CGContextAddArc and CGContextAddRect.
Upvotes: 0
Reputation: 4568
A simple fill algorithm should do. just expand from the point you are on until you meet region end pixels see http://en.wikipedia.org/wiki/Flood_fill you can also try googling for Boundary Fill algorithm
Upvotes: 3