Question

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

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top