2011-08-18 21 views
1

iPhone/iPad用の塗装タイプのアプリケーションを開発しようとしています。私は70%行ったが、1つの機能はそれを完了するための時間がかかります。私はその中に選択された色の機能を持つ選択領域を塗りつぶしに追加しました。私はそれをやったが、それは多くの時間がかかっているか、あまりにも遅く働いている。この機能により、アプリケーション全体がフリーズします。図面ビューの 構造: - のUIView(親ビュー) -UIImageView(SubView1)背景 -UIImageView(SubView2)が色を引くか、描く-toとしてのイメージを維持し-toラインUIView上位レイヤーで塗りつぶし色を選択した領域

In above structure, Parent view is work as a Canvas View and Subview1 is lowerview and Subview2 is upperview. 

My approach :- 
1)finding currnet point. 
2)getting pixtel color. 
3)get screen shot for whole screen. 
4)get array for those pixtel who have a same pixtel color as select pixtel in current screen shot 
5)now we use 4Q pixtel fill color for identifying pixtel who is connected with selected pixtel and making array for all those pixtel. 
6)After getting the final array for the pixtel, we draw a pixtel with selected color. 

Any one help. 
I need a another implementation for Flood fill with a more smooth way functionality. 
Pls provide me a Code sample. 

Thanks in Advance. 
+0

私はflood fillアルゴリズムの多くの実装を見てきました。アップルのドキュメントとCore Graphicsをチェックしましたか?あなたはこれを解決するか、まだ検索していますか? –

答えて

関連する問題